Skip to content

Importing convex mesh types to a world #104

@coolcomfort

Description

@coolcomfort

Hello,

I was referencing the test_basic.html and trying to change the ground types to a convex mesh. I loaded in a mesh with GLTFLoader from THREE. I also went ahead and added it to the scene and can visibly see it. I then repurposed some of the pre-existing ground code in attempt to create my own based on the custom mesh. I set the type to convex, and then set the shape to the geometry buffer of my custom GLTF loaded object. Unfortunately I keep getting the same error:

Cannot read properties of undefined (reading 'parent')

  world.add({
    type: "convex",
    shape: collisionWorld.geometry,
    size: [15, 15, 15],
    pos: [0, 0, 0],
    density: 1,
    friction: 1,
    restitution: 1,
    world: world,
  });

Let me know if you are able to assist.

Thanks,
coolcomfort

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions