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

Added gltf OMI_collider extension support. #154

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

@cyberneticocult
Copy link
Author

I should probably mention that I didn't add the "isTrigger" part of the specification. I wasn't sure how you would want to handle this in the client.

I'm guessing there's a way of registering a collision hull in physx that does an intersection test with other bodies but won't collide with them? Also, would we emit those events on the app the node is a child of? Should the user of the app register listeners for the things they want to detect, or do we just emit all intersection events?

@memelotsqui
Copy link

Ive been doing some testings and so far everything seems correct, but im just double checking since some of the exported examples from https://github.com/cyberneticocult/webaverse-omi-collider-examples, are not working correctly (negative-scale-gltf is not working correctly), but may only be to certain specific cases, as the code looks correct to me.

Collider-types example is working correctly: https://github.com/cyberneticocult/webaverse-omi-collider-examples/tree/main/collider-types-glb So I want to do another test with a custom omi export just to double check everything is correct. (this pr even considered the capsule has to be rotated to adapt to physx as shown in the image)

image

2022-09-21.15-43-33_Trim.mp4

@cyberneticocult
Copy link
Author

I didn't actually test out the negative scale data. I wasn't sure how this should be handled. I'm guessing everything should just use absolute values, but I never checked to see how physx would handle negative scale values.

@cyberneticocult
Copy link
Author

I also left compound colliders undefined, but after some discussions in the OMI discord channel for extensions I was able to get a better idea of what they are.

From the sounds of it, compound colliders are meant to be the same as what Godot has for compound shapes.
https://docs.godotengine.org/en/stable/tutorials/assets_pipeline/escn_exporter/physics.html?highlight=compound#collision-shapes

Colliders can be parented to a compound collider which they will inherit their properties from. I think for the OMI_collider spec the only thing that would be inherited is the "isTrigger" property, but when combined with the OMI_physics_body spec, this will probably have more use.

I was wondering for compounds, when building them, should they all be joined into a single mesh? That would seem to lose the benefit of using box, capsule and hull colliders as they should be cheaper to test against right?

@cyberneticocult cyberneticocult force-pushed the add-gltf-omi-collider-extension branch from 8ddf557 to 8263459 Compare September 24, 2022 23:35
@cyberneticocult
Copy link
Author

I've added some warnings to handle nodes with negative scale or that have been set to compound type. Hopefully that should do for now. There's another related OMI spec (OMI_physics_body) that when it's further along I think it'll make sense to revisit the compound collider to make building dynamic colliders easier.

@cyberneticocult
Copy link
Author

Just also wanted to mention I've added some additional features to the blender addon for making exporting colliders easier.
cyberneticocult/gltf-blender-io-omi-collision-extension@0c7006b

I've also updated a scene I've been working on with OMI colliders that could be helpful for providing test data.
https://cyberneticocult.github.io/webaverse-ld-block-kits/ld-block-kit-01/

@lalalune
Copy link
Contributor

lalalune commented Dec 2, 2022

@memelotsqui can you migrate this to https://github.com/webaverse/compiler please :)

@memelotsqui
Copy link

Alright!, will get to work on it :)

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

Successfully merging this pull request may close these issues.

3 participants