Search the Community
Showing results for tags 'bakecurrenttransformintovertices'.
-
I have problem with physics and mesh impostor with sphere. I create some componets in blender. And add each component texture. I create pathMesh from components. (pathMesh have multi materials and textures because each component has its own material and texture) If I load babylon with sandbox it load OK (but sandbox doesn't have pathMesh.bakeCurrentTransformIntoVertices(); . If I have pathMesh.bakeCurrentTransformIntoVertices(); in loop then pathMesh is loaded without textures and physics works OK. If I remove pathMesh.bakeCurrentTransformIntoVertices(); then pathMesh is loaded correctly with textures, but physics doesn't work as it should. var pathMesh; meshTask.onSuccess = function (task) { for (var i=0; i<task.loadedMeshes.length; i++ ){ var newMesheI = task.loadedMeshes[i]; if ( newMesheI.id == "Path" ) { pathMesh = newMesheI; pathMesh.checkCollisions = true; pathMesh.bakeCurrentTransformIntoVertices(); // this line works ok with physics but pathMesh doesn load correcly with textures pathMesh.pBody= perplexus.setPhysicsState(BABYLON.PhysicsEngine.MeshImpostor , { mass: 0, friction: 0.4, restitution: 0 }); } ... I need pathMesh.bakeCurrentTransformIntoVertices(); and correcly inported pathMesh with its textures? Can anybody help me solve this problem? Any advice? What should I do? Am I missing anything? Greetings