I have a scene where I’m loading a GLTF object and creating a bunch of instances and then attaching physics impostors to each instance.
This kind of works, but I’m bumping up against a couple of strange behaviors (bugs?) that seem to be fighting against each other.
- In order to get instanced rendering to work properly, I have to parent the instances of the glTF mesh to the parent of the mesh (i.e., to the _root node) as described as the second option in the “Instancing a glTF object” on this page (Instances | Babylon.js Documentation). If, instead, I try mesh.setParent(null) before creating the instances, I end up in a situation where instanced rendering doesn’t work. i.e., the sign of the determinant of the instance mesh matrix doesn’t match the sign of the determinant of the original mesh (inside InstancedMesh::_activate), and so each instance is rendered as a “regular” mesh.
- Because I have to keep the parent of the mesh (as described in point #1), the PhysicsImpostor system warns me that “A physics impostor has been created for an object which has a parent”. This happens despite the fact that I’ve set “ignoreParent: true” in the PhysicsImpostor options parameter.
Is it a bug that PhysicsImpostor constructor isn’t checking “ignoreParent” before warning about parented object?
Am I doing something wrong to cause the “mesh.setParent(null)” version of glTF instancing to not work properly?
Thanks in advance!
-dh