Jump to content

GUI - don't limit control.linkWithMesh() to root level


royibernthal
 Share

Recommended Posts

It'd be great if meshes linked by control.linkWithMesh() would not be limited to the root level of adt, so that controls that are parented any number of containers would be valid for linkWithMesh().

I suppose this would require a further translation of projectedPosition in AdvancedDynamicTexture/_checkUpdate() from the global coordinates system to the control's local coordinates system before calling control._moveToProjectedPosition().

 

Deltakosh - What do you think about creating localToGlobal() and globalToGlobal() functions in adt? These could be useful generic functions, as well as naturally solve this issue. I'm not sure how to best implement such functions, so I guess this is a feature request :)

Link to comment
Share on other sites

If you link a control with a mesh, you want it to not be controlled by anything else. So no parenting or you will inherit from parent transformation as well (which will break everything)

Link to comment
Share on other sites

On 4/21/2018 at 4:31 PM, royibernthal said:

controls that are parented (-to) any number of containers

My dog got scared when you said that, Royi.  :)  Copy-of control, probably fine.  Same control... being a child of multiple containers?   That might crack the planet.  :)

(Wingy grabs a hard hat and a roll of Gorilla tape, just in case.)  I could easily be wrong, though.  Interesting subject.  I can tell Royi is neck-deep in dev... talking about moveToProjectedPosition() and _checkUpdate()  [mesh-tracking funcs for linkedMesh].  He's codin'-up a GUI masterpiece.  :) 

Why did I need to comment?  I dunno.  Mental problems, I suspect.

Link to comment
Share on other sites

Deltakosh - What if I have adt -> container -> button, and I'd like the button to track a mesh? For that it'll have to be translated into the coordinates system of the container. That way we fix parent transformation that "breaks" this.

Let me know if I'm still missing something.

 

3 hours ago, Wingnut said:

Same control... being a child of multiple containers?

I'm talking about nesting :)

Link to comment
Share on other sites

So it is not position related and we don't need a toLocal/toGlobal API.

You only want to control the rendering order (I can get that). So we could reduce the constraint to be at root level for sure as long as it is clear that you cannot inherit from parent position.

Furthermore inside a container you will be clamped to parent's bounding box which could be weird if the mesh move outside of container limits

Link to comment
Share on other sites

18 minutes ago, Deltakosh said:

So it is not position related and we don't need a toLocal/toGlobal API.

In my case it's not position related, but in order to keep the positions calculations and logic intact, I thought a simple globalToLocal would do the job, instead of limiting position in some unnatural way when a control is linked to a mesh, unless you have something better in mind.

 

20 minutes ago, Deltakosh said:

Furthermore inside a container you will be clamped to parent's bounding box which could be weird if the mesh move outside of container limits

It seems to me like something obvious that the programmer will have to take into account, in my case the container is simply fullscreen.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...