Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Promise Rejection: TypeError: i.calculateWorldAABB is not a function. (In 'i.calculateWorldAABB(o,n,l.lowerBound,l.upperBound)', 'i.calculateWorldAABB' is undefined) #146

Open
hg0428 opened this issue Oct 29, 2023 · 0 comments

Comments

@hg0428
Copy link

hg0428 commented Oct 29, 2023

let loader = new GLTFLoader();

// Load a glb model
loader.load('models/chernovan_nemesis.glb', function (gltf) {

  // Get the model and its animations
  let model = gltf.scene;
  let animations = gltf.animations;
  console.log(gltf, model);
  // Add the model to the scene
  scene.add(model);

  // Get the geometry of the model
  let object3D = gltf.scene.children[0];
  console.log(object3D);

  const shape = threeToCannon(object3D, { type: ShapeType.BOX });
  let body = new CANNON.Body({ mass: 1, shape: shape });

  // Add the body to the world
  world.addBody(body);

object3D is indeed a valid Object3D. What is the problem here? I am using the latest versions of Cannon-es and Three.js.
Why won't it work?
Screenshot 2023-10-28 at 9 39 12 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant