I'm making an FPS game, and I'm using Cannon.js as the physics engine. I recently figured out how to do this with simple objects, such as BoxGeometry, SphereGgeometry, and PlaneGeometry, but what about a loaded model? I saw this post, but I get the error THREE.Geometry is not a constructor (its deprecated im pretty sure: https://github.com/schteppe/cannon.js/issues/444)
Here is my code:
const loader = new THREE.GLTFLoader();
loader.load(`Assets/Maps/mapone.glb`, function ( gltf ) {
gltf.scene.scale.set(40, 40, 40);
scene.add(gltf.scene);
let g = new THREE.Geometry().fromBufferGeometry(gltf)
console.log(g)
});
All help is appreciated! Thanks!