Active ragdoll physics

Has anybody had any experience with creating active ragdolls in Babylon?

For example when you run, but a box hits you from above, the head reacts to the box while still trying to keep the animation going?

cc @Cedric

I didn’t try but I’m curious to see how people have managed to do it :slight_smile:

I’m also interested in this. I found this article http://peyman-mass.blogspot.com/2018/01/how-to-implement-active-ragdoll.html?m=1

It mentions this, and I quote:

Physically based animation is also known as active ragdoll or animation driven ragdoll and if you have used Havok animation before, it’s called powered ragdoll in Havok animation.

Which makes me wonder, now that Babylonjs can use havok as a physics engine, does this mean that we also have access to this so called “powered ragdoll”?

1 Like

Havok wasm build doesnt contain everything possible. We cherry pick what’s needed or the wasm would be multiple Mb. Ragdoll is not used by everyone so, it’s preferable to have our own version based on user feedback.

I see that this playground https://playground.babylonjs.com/#DLPNQT#6 has an animation group that keeps playing even after the ragdoll is turned on. I’m guessing the animation is ignored because the physics are taking precedence. Is there a way that I can extract the current animation frame values for each bone and convert them to the appropriate physics force in order to blend the ragdoll back into the animation shape over time?

In playing around in the js console I see I can get what frame the animation is on using:

scene.animationGroups[0].animatables[30].masterFrame

But I haven’t figured out how to see what value the frame is supposed to be at.

1 Like

Once you have a frame number, you can get the value of an animation by calling Animation.evaluate(frame). For a given animation group, you can get the list of all animations by calling AnimationGroup.targetedAnimations.