After exporting a mesh from Blender and loading it from a GLB file, I encountered an issue with the PhysicsImpostor causing the entire model to flip upside down. Can anyone help me troubleshoot this problem?
export class Player extends BABYLON.AbstractMesh {
constructor(scene, config: EntityConfig) {
super(config.name, scene);
BABYLON.SceneLoader.ImportMesh('', 'assets/', config.file, scene,
(newMeshes, particleSystems, skeletons, animationGroup) => {
newMeshes.forEach(m => {
if (!m.parent)
m.setParent(this);
m.showBoundingBox = config.IS_DEBUG;
m.physicsImpostor = new BABYLON.PhysicsImpostor(m, BABYLON.PhysicsImpostor.);
});
this.scaling.set(.2, .2, .2);
this.setAbsolutePosition(new BABYLON.Vector3(0, 3, 0));
scene.registerAfterRender(() => {
animationGroup[0].play(true);
});
this.physicsImpostor = new BABYLON.PhysicsImpostor(this, BABYLON.PhysicsImpostor.SphereImpostor,
{
mass: 1,
restitution: .1
}, scene);
this.showBoundingBox = config.IS_DEBUG;
});
}
}