#Best way to add colliders to a gltf?

18 messages · Page 1 of 1 (latest)

flint surge
#

New to this.
I have a model I want to ragdoll, what are my options for setting up the colliders?
I can only think of making an app in bevy to add them manually in real time and serialize.
Alternatively maybe blender has some way to export extra data into the gltf?

glossy wharf
#

May be bevy_rapier will help?

flint surge
#

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.

mint trail
#

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

GitHub

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

flint surge
#

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.

next cosmos
flint surge
#

But I want to add colliders to an armature, which is pretty much impossible without a visual editor like blender.

next cosmos
#

Any reason you cannot add them via blender and then use the mesh to create colliders?

flint surge
#

I want to avoid using mesh colliders for primitives.

next cosmos
#

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.

flint surge
#

I suppose.

next cosmos
#

I'd suggest sticking with mesh colliders and then looking into optimizing that if you find it to be a measurable bottleneck when profiling

#

Since you can always go and replace them by manual primitives later