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

OMI_collider trimeshes with more than one primitive #164

Open
robertlong opened this issue May 4, 2023 · 3 comments
Open

OMI_collider trimeshes with more than one primitive #164

robertlong opened this issue May 4, 2023 · 3 comments
Labels
old is this still relevant ?

Comments

@robertlong
Copy link
Member

Currently. the OMI_collider spec states:

The glTF mesh in the array MUST be a trimesh to work, and should be made of only one glTF mesh primitive (one surface).

Currently in the thirdroom-unity-exporter we export colliders that point to meshes with multiple primitives. This is mostly due to it being easy to call exporter.ExportMesh() and get back a mesh id for the collider's trimesh. That function will return a mesh with multiple primitives if the source mesh has multiple primitives. In the assets we have purchased on the Unity Asset Store, that is often how they are set up. Implementing this in our engine with Rapier basically involves adding multiple trimesh colliders to a single rigid body (compound collider) and then it "just works". I think it's a bit constraining to only allow a single primitive per trimesh collider in the spec.

We've gone back and forth on this issue multiple times, but I think I'm now on the side of supporting multiple primitives per trimesh/hull. It'll make our implementations easier to build (no special logic to export a collider's trimesh vs a mesh).

If it's absolutely vital to have a single primitive per trimesh, then we need to change our exporter such that it exports multiple nodes under the rigidbody and is used as a compound collider this way. I think this is an unnecessary step though. If we're supporting compound colliders already, why not support multiple primitives per trimesh?

@aaronfranke
Copy link
Member

Can you provide an example file that uses multiple mesh primitives in one collider? I guess I can just implement this in Godot by having it merge the meshes together and then use that to generate a collider.

@yankscally yankscally added the old is this still relevant ? label Jan 3, 2025
@yankscally
Copy link

OMI_collider is in the archive folder.
I'm marking this issue for spring cleaning.

@aaronfranke
Copy link
Member

The same question applies for OMI_physics_shape trimesh shapes.

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

No branches or pull requests

3 participants