vahith Posted March 10, 2015 Share Posted March 10, 2015 hi all,i trying to use the movewithcollision( ) method on mesh which i created by blender,if i use single mesh without using join option in blender its working fine, but when i use two meshes join as one mesh then its not working for eg:if i create one cube in blender then import into scene then collision is working fine,but when i am creating two cube then i join as one using join option, now movewithcollision not working. kindly suggest me how to achieve this.. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 19, 2015 Share Posted March 19, 2015 Hi Vahith. Interesting! I'm not qualified to comment, but maybe you could answer some questions I have. Do you know if Blender "join"... makes a "subMesh"? Do you think one of your cubes... is a subMesh of the other? (after Blender join) And, does moveWithCollision work good for ONE of the cubes in the 2-cube joined test? Have you tried joining the two cubes with BabylonJS mesh merge? *shrug* It might be interesting to know exactly what a Blender "join" does to a mesh (or two). Quote Link to comment Share on other sites More sharing options...
vahith Posted March 20, 2015 Author Share Posted March 20, 2015 hi wingnut..yes after creating babylon file it containes data someting like thismeshes":[{"name":"Model","id":"Model","materialId":"dc_1.Multimaterial#0","billboardMode":0,"position":[0,0,0],"rotation":[0,0,0],"scaling":[0.01,0.01,0.01],"isVisible":true,"isEnabled":true,"useFlatShading":false,"checkCollisions":true,"receiveShadows":falsesubMeshes":[{"materialIndex":0,"verticesStart":0,"verticesCount":183,"indexStart":0,"indexCount":342},{"materialIndex":1,"verticesStart":183,"verticesCount":30,"indexStart":342,"indexCount":54},{"materialIndex":2,"verticesStart":213,"verticesCount":152,"indexStart":396,"indexCount":288},{"materialIndex":3,"verticesStart":365,"verticesCount":54,"indexStart":684,"indexCount":216},{"materialIndex":4,"verticesStart":419,"verticesCount":24,"indexStart":900,"indexCount":36},{"materialIndex":5,"verticesStart":443,"verticesCount":4,"indexStart":936,"indexCount":6}] Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 24, 2015 Share Posted March 24, 2015 Just a guess since you seem to be able replicate this with cubes as well, but could you do an apply of scaling? I am not that familiar with collisions (yet), but sub-meshes are for multi-materials. Does problem still happen if you remove all materials? Beyond that, there is this imposter thing. I am not the source for that. @wingnut - I used Blender join on my blender created checkboxes. Looked at exported source code (TOB exporter variant), I get no sub-meshes. Just the global one. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.