Skip to content

ConvexPolyhedron with imported geometry can't collide against each other ? #135

Answered by Faber-smythe
Faber-smythe asked this question in Q&A
Discussion options

You must be logged in to vote

So…
THE CAUSE :
In the process of cuting quads into triangles, Blender GLTF export multiplies the vertices. This doesn’t bother the rendering of the meshes in Three.js, but causes crashing deep into cannon-es script when two of them collide with each other.

THE FIX :
The geometry can be cleaned up with geometry.mergeVertices(). This caused the duplicated vertices to disappear, and the geometry.faces to be remapped onto the new geometry.vertices.

The CodeSandBox here shows the issue and the fix.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@stockhuman
Comment options

Answer selected by Faber-smythe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants