Jump to content

Why does the mesh impostor only collides with spheres?


X3MC2
 Share

Recommended Posts

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 ?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 weeks later...

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.

 

Link to comment
Share on other sites

  • 4 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...