#Best way to add colliders to a gltf?
18 messages · Page 1 of 1 (latest)
May be bevy_rapier will help?
Yeah, I need to set up the colliders for rapier.
After googling a bit, there doesn't seem to be an easy solution.
I'll just do an app for it.
have a look at foxtrot in their blender scene they use the 'extra fields' section to add tags that in bevy are then read into components. So adding the "ColliderMarker" tag translates into the component being used for collisions, or the "Hidden" tag makes the component invisible in game
The all-in-one Bevy 3D game template for desktop. Contribute to janhohenheim/foxtrot development by creating an account on GitHub.
in the documentation under level instantiation they explain how it works and link to a github repo that shows it in more detail
Looks great. Thank you!
After looking into it, foxtrots approach doesn't help me.
They create colliders automatically from exported meshes.
I want to manually place primitive colliders parented to bones.
In the same place where the colliders are created, you could just add primitives instead while iterating through the children. Check out iter_descendants to go over all children in the hierarchy and filter out the bones. Then, insert your primitive colliders 🙂
System parameter that provides selective access to the Component data stored in a World.
That would have the same effect as parsing primitives from the blender extras field. I.e. I would need to create colliders in code.
But I want to add colliders to an armature, which is pretty much impossible without a visual editor like blender.
Any reason you cannot add them via blender and then use the mesh to create colliders?
I want to avoid using mesh colliders for primitives.
For simple shapes and if you're not adding millions of ragdolls, the difference between the mesh colliders and primitives shouldn't be too big.
I suppose.