-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offset drag instantiated scenes that result in a collision by its bounds to mitigate overlap #88511
Offset drag instantiated scenes that result in a collision by its bounds to mitigate overlap #88511
Conversation
d4eed20
to
e046f54
Compare
Could have a proposal since this is added functionality, if so I would also suggest adding this functionality to the move and/or select mode tools because this could be quite useful for them as well and isn't easily recreated by any other existing functionality afaik. Regarding the implementation, how does it interact with non-axis aligned surfaces? |
I need to get back into this, but I believe that preview nodes are packaged into a temporary node that is not rotated, so the bounds are always axis aligned. My current issue is that the scenes origin isn't always the center of the AABB, so that needs to be factored into the offset, if that even makes sense.
Would be cool. |
Yeah, I mean, if the the surface you're instancing onto is not axis aligned, not the scene you're instancing. Does it stick the center of the closest aabb side to the surface or something? |
The current mechanism for Godot is to use the intersection of a viewport ray and a collider (which doesn't have an AABB), to determine the global position of where to instantiate the scene. This means that currently you can't snap to meshes without colliders, and the collider shape doesn't necessarily have to match the mesh. I do have this PR: #87969 that does factor in the target AABB by using meshes instead of colliders, but it has its own issues. The answer for an ideal solution that encompasses flexible snapping to whatever layer is probably somewhere in between. An interesting and maybe dumb idea is to temporary build a collision sibling similar to how you can manually do in the editor via: and then snap to that. It's a tricky problem. |
e046f54
to
42f738d
Compare
42f738d
to
a60ab6c
Compare
…nds to prevent overlap Co-Authored-By: Robbie Cooper <[email protected]>
a60ab6c
to
14f6c81
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! |
@cooperra
Before:
2024-02-18.13-38-22.mp4
After:
2024-02-18.13-37-09.mp4