How to do intersectsMesh with child meshes?

I have meshes in my scene that each have a child mesh which represents the volume I want to detect collisions within. These children are not necessarily the bounding box of the parent mesh. Once I create the parents, create the children, add children to parents, move the parents into position, and compute everyone’s world matrix, the parent meshes are computed to not intersect. But the child meshes do intersect, according to intersectsMesh. If I call scene.render() before checking intersections, the child meshes do not intersect.

What other function do I need to call to update the child meshes in the same way render() does?

If you pass true to your calls to computeWorldMatrix then it will force the matrix to be updated right away, instead of waiting until the next frame, and then there’s no need to call scene.render(). :slight_smile:

1 Like