-
Notifications
You must be signed in to change notification settings - Fork 19
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
base: main
Are you sure you want to change the base?
Added gltf OMI_collider extension support. #154
Conversation
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? |
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) 2022-09-21.15-43-33_Trim.mp4 |
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. |
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. 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? |
8ddf557
to
8263459
Compare
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. |
Just also wanted to mention I've added some additional features to the blender addon for making exporting colliders easier. I've also updated a scene I've been working on with OMI colliders that could be helpful for providing test data. |
@memelotsqui can you migrate this to https://github.com/webaverse/compiler please :) |
Alright!, will get to work on it :) |
Added support for the OMI_collider extension proposed by the OMI group in the following specification.
https://github.com/cyberneticocult/gltf-extensions-omi-collider/tree/main/extensions/2.0/OMI_collider
Scenes can be exported with an extension addon for the blender gltf exporter.
https://github.com/cyberneticocult/gltf-blender-io-omi-collision-extension
Test data for scenes that use the OMI_collider extension can be found at the following static resource urls.
https://cyberneticocult.github.io/webaverse-omi-collider-examples/boxes-glb/
https://cyberneticocult.github.io/webaverse-omi-collider-examples/boxes-gltf/boxes.gltf
https://cyberneticocult.github.io/webaverse-omi-collider-examples/collider-types-glb/
https://cyberneticocult.github.io/webaverse-omi-collider-examples/collider-types-gltf/collider_types.gltf