chandlerprall / Physijs

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

Physijs.Mesh from an imported OBJ not working #278

Open ghost opened 8 years ago

ghost commented 8 years ago

When i drop BoxMeshes on the obj, they just pass through. Here's my code:

loader.load( 'models/model.obj', function ( event ) { var geometry; event.traverse( function ( child ) { if ( child instanceof THREE.Mesh ) { geometry = new THREE.Geometry().fromBufferGeometry( child.geometry ); } } ); var mesh = new Physijs.Mesh( geometry, material ); scene.add(mesh); });

Ithamar commented 5 years ago

you are not supposed to use Physijs.Mesh directly, it is just an (abstract) base class. You should choose from BoxMesh, SphereMesh, ConcaveMesh, etc.