chandlerprall / Physijs

Physics plugin for Three.js
MIT License
2.77k stars 455 forks source link

Collisions don't work with concave meshes (mesh not scaled) #211

Open huckfinn7890 opened 9 years ago

huckfinn7890 commented 9 years ago

As a test, I edited the following line(Line:88) in examples/collisions.html ground = new Physijs.BoxMesh( with ground = new Physijs.ConcaveMesh(

The blocks just fall through, sometimes they collide with something, tilt and fall through. Can someone confirm if this is a bug or if I'm doing something wrong? If it is a bug, a couple of pointers as to what might be causing the problem would be great. I have some cycles to spare and would like to see this fixed.

Also, structuring a physics engine as a threejs plugin is extremely helpful. Thanks for that.

chandlerprall commented 9 years ago

Are they moving fast when they collide? If so they may be suffering from tunneling and you can try enabling CCD with values like http://bulletphysics.org/mediawiki-1.5.8/index.php/Anti_tunneling_by_Motion_Clamping

Arlen22 commented 9 years ago

I have the same problem. The item begins to drop slowly, and then stops when it is about halfway into the table. Usually it will slant a little bit and then just sit there jittering. Also, they no longer collide with other ConcaveMesh objects.

riccardolardi commented 8 years ago

Same problem here with an imported JSON file from Blender - I don't do any scaling nor any other modification to the mesh - and the object that's supposed to collide would collide at first, but then suddenly starts falling through the mesh, like if there were "holes" in the mesh I've imported. Any clues to this?