-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Use collision detection ray to reposition an object already in the scene #96740
Use collision detection ray to reposition an object already in the scene #96740
Conversation
2919e2e
to
de7a8a5
Compare
de7a8a5
to
6c12605
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.
Tested locally (rebased on top of master
f032af7), it works as expected.
I miss a way to offset the object so that it appears outside the ground/wall though. The dragged object's collision shape AABB should be taken into account (if the dragged object is a PhysicsBody3D or CollisionShape3D). Without having this feature in place, you either have to drag a parent node that is offset compared to its child (which can break center of mass with physics nodes) or have to reposition the object manually later on, which kind of defeats the point of the feature for most objects.
Additionally, using the mouse wheel could work to offset the position in local space (i.e. relative to the current view direction)? Something like this (from Cube 2: Sauerbraten's editor):
o.mp4
There could also be automatic rotation support according to the collision normal, but this can be left for a future PR.
Currently does not have a key binding by default:
I suggest binding Shift + G by default to match #78148.
Wouldn't this be resolved by: #88511? |
Yes, this works perfectly 🙂 |
6c12605
to
0edad9e
Compare
Done. |
0edad9e
to
420dbf8
Compare
420dbf8
to
fb768a7
Compare
Rebased and modified to work with: #88511 |
Thanks! |
Question, in the Dev 4 snapshot blog, this video in the top post is shown, but this shows the collisionshape and mesh fully intersecting the surface (the snapping seems to be at the gizmo origin / anchor? |
I'm not sure I understand the question, but if you're suggesting that the video in the snapshot post is somewhat misleading to the functionality in the build I would agree. This PR was created separately yet complimentary with #88511, which was also merged prior to dev 4 build, and the behavior of both is reflected within the dev4 build of the engine. The final position is offset by bounds of the object being positioned. |
Would it be impossible to make the box not clip the conveyor belt, like offset the placement by half the AABB of the box? I think it would be a much more plausible scenario that you don't want the objects to intersect than that they would intersect like shown in the video. |
This is the behavior in the latest build. This PR was created along with #88511 but were both merged. |
Closes: godotengine/godot-proposals#755
Related: #88511
Currently only works with one object at a time. Multiple objects would probably be a future PR if desired.
Currently does not have a key binding by default:
Works similar to "instant transformations" in that pressing the key initiates the function, and left click commits it.
2024-09-19.17-48-36.mp4