-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Open
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsA-PickingPointing at and selecting objects of all sortsPointing at and selecting objects of all sortsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
Description
Bevy version
0.15.3
What you did
Might be a bug with mesh_picking
. I noticed that when I adjusted the vertex positions on a Plane3d
in real time the Trigger<Pointer<Click>>
events would still fire, but only based on the dimensions of the initial mesh.
The updates I made to the Mesh3d
vertex positions wouldn't affect it. Visually I could see the new mesh was larger, but if I clicked anywhere in those zones nothing happened. I had to click the original position to get it to fire.
I was using mesh.insert_attribute(Mesh::ATTRIBUTE_POSITION, new_positions.clone());
to adjust the vertex positions.
What went wrong
- Adjusting
Mesh3d
vertex positions does not updatemesh_picking
Additional information
I found I was able to get it to work, as intended, after updating the vertex position by removing the Aabb
component and re-adding it:
// Update the AABB to refresh raycasting
commands.entity(parent.get()).remove::<Aabb>();
commands.entity(parent.get()).insert(mesh.compute_aabb().unwrap());
StudioLE
Metadata
Metadata
Assignees
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsA-PickingPointing at and selecting objects of all sortsPointing at and selecting objects of all sortsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!