Pick() and bone animation

Hey everyone,
I’m facing an issue while trying to find the intersection point between a ray casted from the camera and a mesh along that ray’s trajectory. It all works perfectly when the mesh doesn’t use skeletal animations. However, once the mesh gets animated using bones, the problem arises—the pick() method returns the intersection point as though the mesh was still in its original unanimated state, completely ignoring any deformation caused by bone movement.

Any help would be greatly appreciated!

You may find some solutions in this thread - Ray picking in SkinnedMesh

1 Like

Thanks

for (let i = 0; i < this.scene.meshes.length; i++) this.scene.meshes[i].refreshBoundingInfo(true)
1 Like

Or, with AssetContainers, you may iterate only its meshes (I believe you don’t need this for the whole scene).

Yeah, it seems I’ll likely need to create an array containing only those meshes which can potentially intersect with the ray, and then update just these

1 Like