pmndrs/use-cannon

Deprecated function example

Kevw94 opened this issue · 0 comments

Hello, there is a problem in your example because of a deprecated method from Three.js : Three.Geometry()

So function bellow in example demo-ConvexPolyhedron.tsx doesn't work with Three.js r151 :

function toConvexProps(bufferGeometry: BufferGeometry): ConvexPolyhedronProps['args'] {
const geo = new Geometry().fromBufferGeometry(bufferGeometry)
// Merge duplicate vertices resulting from glTF export.
// Cannon assumes contiguous, closed meshes to work
geo.mergeVertices()
return [geo.vertices.map((v) => [v.x, v.y, v.z]), geo.faces.map((f) => [f.a, f.b, f.c]), []]
}

Thanks for all you are doing for developers :)