X3MC2 Posted October 31, 2016 Share Posted October 31, 2016 Why ? var rawVerts = object.getVerticesData ? object.getVerticesData(BABYLON.VertexBuffer.PositionKind) : []; var rawFaces = object.getIndices ? object.getIndices() : []; BABYLON.Tools.Warn("MeshImpostor only collides against spheres."); returnValue = new CANNON.Trimesh(rawVerts, rawFaces); Even tho CannonJS supports mesh/plane collision ? : Demo : https://schteppe.github.io/cannon.js/demos/bunny.html Source : https://github.com/schteppe/cannon.js/blob/master/demos/bunny.html // ground plane var groundShape = new CANNON.Plane(); var groundBody = new CANNON.Body({ mass: 0, position: new CANNON.Vec3(0,0,-5) }); groundBody.addShape(groundShape); world.addBody(groundBody); demo.addVisual(groundBody); Edit: Ok, I overlooked the fact that the Mesh impostor is infact a Trimesh shape (https://schteppe.github.io/cannon.js/demos/trimesh.html). So can you add ConvexPolyhedron shapes in the next release please ? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted October 31, 2016 Share Posted October 31, 2016 Because of how aabb works, fastest method is to test with a circle (and simplest).. your not not going to get any additions to physics unless you program it yourself, or wait for one of the power players to release a new physics engine. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 31, 2016 Share Posted October 31, 2016 Ping @RaananW Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 17, 2016 Share Posted November 17, 2016 MeshImpostor is, indeed, a TriMesh. I can add a ConvexPolyhedron, but it might take a bit of time. We had it already, BUT it wasn't calculated correctly on our side, and people didn't really understand how to use it. I will add it to my todo list. Which is as long as the Israeli-Palestinian conflict. ian, X3MC2, Pryme8 and 1 other 4 Quote Link to comment Share on other sites More sharing options...
X3MC2 Posted December 14, 2016 Author Share Posted December 14, 2016 @RaananW Thank you for the great work you've done ! Wingnut 1 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.