@eulerjs/bvh
v0.1.3
Published
Triangle mesh colliders for eulerjs, on three-mesh-bvh
Maintainers
Readme
@eulerjs/bvh
Triangle mesh colliders for eulerjs: a level, a building or a rock face as a collider, found quickly with a bounding volume tree from three-mesh-bvh.
npm install @eulerjs/bvh @eulerjs/core three three-mesh-bvhimport { Body } from '@eulerjs/core';
import { MeshCollider } from '@eulerjs/bvh';
world.addBody(new Body({ type: 'static', colliders: [new MeshCollider({ geometry: level.geometry, friction: 0.7 })] }));Both sides of every triangle are solid, so the mesh needn't be closed. Edges between nearly flat neighbouring triangles never push on their own, so bodies roll and slide across the mesh without catching on them. Every convex collider collides with it, and ray casts, shape casts and overlap tests find it. It is for static and kinematic bodies: a mesh has no volume to give a mass.
Needs three 0.166 or later and three-mesh-bvh 0.9 or later. See the guide.
MIT licensed.
