BIH Collision tree not updating

Okay I have this procedural mesh that I want to ray cast, but the informations for the ray to collide with my mesh is only generated during first ray cast. Any other vertices added to my mesh will not considered with the ray casting.
Is there something that I have to update in my mesh other than the bound? Or is it a bug?

@teencrusher said: Okay I have this procedural mesh that I want to ray cast, but the informations for the ray to collide with my mesh is only generated during first ray cast. Any other vertices added to my mesh will not considered with the ray casting. Is there something that I have to update in my mesh other than the bound? Or is it a bug?

Mesh.createCollisionData();
Mesh.updateBound();

And the Geometry, you’ll want to make sure you call:

Geometry.updateModelBound();

Okay Geometry.updateModelBound(); will call mesh.updateBound(); in the function.
I will try the Mesh.createCollisionData(); right now.

Ok this fixed my issue, but i think that whenever a mesh’s position buffer is modified a flag should be raised to update the BIH tree.

1 Like
@teencrusher said: Ok this fixed my issue, but i think that whenever a mesh's position buffer is modified a flag should be raised to update the BIH tree.

Not really, no. That would make animation too resource intense.

1 Like
@teencrusher said: Ok this fixed my issue, but i think that whenever a mesh's position buffer is modified a flag should be raised to update the BIH tree.
Not everybody needs accurate pick on animated mesh, and that's not a free operation.