overte-org / overte

Overte open source virtual worlds platform.
https://overte.org/
Other
132 stars 48 forks source link

flow: Capsule collider type #803

Open JulianGro opened 5 months ago

JulianGro commented 5 months ago

Currently there is only sphere colliders usable for flow. https://apidocs.vircadia.dev/MyAvatar.html#.FlowCollisionsOptions This is fairly limiting and doesn't allow more complicated stuff like skirts. With just one sphere per bone, you cannot have a skirt influenced by flow without it clipping into the legs or even the hip. The closest alternative is to not use flow on the skirt at all and weight the skirt to the legs.

If we take this collider from an fst file as an example:

flowCollisionsData = {"LeftArm":{"offset":{"x":0,"y":0.02,"z":0},"radius":0.05,"type":"sphere"}}

I would suggest adding a capsule collider type and adding a tail offset to essentially get two spheres which are connected to a capsule:

flowCollisionsData = {"LeftArm":{"offset":{"x":0,"y":0.02,"z":0},"radius":0.05,"tail":{"x":0,"y":1.02,"z":0},"type":"capsule"}}

This is also needed for the VRM 1.0 spec.