I recently changed my player from a simple boxmesh, to an fbx model, and I want to recompute the bounding box of it after transformations. I copied the old code I used to update the bounding box of a boxmesh, however that didn’t work. (playerMesh is the actual fbx model)
Here is my code
const playerBox = new THREE.Box3().setFromObject(playerMesh);
function updatePlayerBox() {
playerMesh.updateMatrix();
playerMesh.updateMatrixWorld(true);
playerBox.copy(new THREE.Box3().setFromObject(playerMesh));
playerBox.applyMatrix4(playerMesh.matrixWorld);
};