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

ColliderDesc.convexMesh does not work #234

Open
coolvision opened this issue May 6, 2023 · 1 comment
Open

ColliderDesc.convexMesh does not work #234

coolvision opened this issue May 6, 2023 · 1 comment

Comments

@coolvision
Copy link

Creating a collirer with RAPIER.ColliderDesc.convexMesh does not work.
Here is a simple test case:

    let geometry = new THREE.BoxGeometry(size, size, size);
    let mesh = new THREE.Mesh(geometry, new THREE.MeshLambertMaterial({color: color}));
    let collider_desc = RAPIER.ColliderDesc.convexMesh(mesh.geometry.attributes.position.array, mesh.geometry.index.array);

inputs should be correct, THREE.BoxGeometry is convex.
But, this causes an error:

rapier3d-compat.js:38 Uncaught Error: expected instance of IA
    at a (rapier3d-compat.js:38:11)
    at l.createCollider (rapier3d-compat.js:467:7)
    at sI.createCollider (rapier3d-compat.js:3807:236)
    at eI.createCollider (rapier3d-compat.js:4099:27)
    at init (main.js:70:26)
    at async main.js:20:1

can be reproduced in sandbox: https://codesandbox.io/p/github/coolvision/rapier_js_examples/master?workspaceId=e7df68ff-e684-4891-81ac-cef3e7594869

@frankieali
Copy link

frankieali commented Jul 11, 2023

I ran into this problem as well. My data would work as a convexHull but not as a convexMesh. I was able to get convexMesh to work by excluding the indices argument and only providing the vertices

Update: I'm wondering if the underlying issue is with the indices ArrayBuffer data type.

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

2 participants