keth retweeted
Same 14 kg ball, same rapier.js world.
Left: the joint motors switch off at contact, so it's a plain ragdoll.
Right: 12 joint motors keep pulling toward the pose. It staggers and stands back up.
Watch 👇
▸ The problem
Ragdolls fall like puppets with cut strings, and keyframed hit reactions ignore what actually hit them. An active ragdoll sits in between: the body is fully simulated, but every joint has a motor that tries to hold a pose. Topic via @kethdev. I built one on rapier.js to see what it takes.
▸ How it works
1. Every limb is a rigid body: 13 bodies, 86.7 kg in total. No animation clip or IK moves them. The physics engine does.
2. Every joint is a revolute ImpulseJoint with a position motor, configureMotorPosition(target, stiffness, damping). With MotorModel.ForceBased, stiffness is torque per radian of error. So the motor is a spring-damper the solver applies inside the joint constraint.
3. Targets are a standing pose with slightly bent knees. Hips, knees and ankles get 1,500 N·m/rad. The spine gets 0.7× that. Arms get 0.04× or less, so they flop.
4. A balance rule runs every step. It measures how far the centre of mass is from the feet, and how fast it's moving. Then it adds that offset to the ankle and hip targets, so the body leans back over its feet.
▸ What I hit
Pose tracking alone doesn't balance anything. After a hit, the motors hold the shape and the whole body tips over its heel like a statue. The heel is only 10 cm behind the ankle.
The balance rule fixed small hits. In early tests it survived an 8 kg ball and fell at 9 kg. So I added a third piece that many active-ragdoll setups use: a capped upright torque on the pelvis. It's 300 N·m/rad, capped at 112.5 N·m. It isn't a joint muscle. It's a helper force, and the video labels it.
With MotorModel.AccelerationBased, the same numbers couldn't hold the body up. ForceBased did.
▸ My build
rapier.js 0.19.3 (the newest release at commit 9f638c5), stepped headless at 240 Hz with 8 solver iterations, then played back in three.js. The mannequin, pendulum and balance rule are mine. The ball hits the chest at 5.0 m/s. The active body leans back 27.5° and is upright again 2.8 s after the hit, without moving its feet.
The stiffness sweep: at 400 it can't hold the pose and falls. At 10,000 it stays rigid and skids 0.9 m across the floor.
▸ Trade-offs
+ Hit reactions come from the actual impulse, so no two are alike
+ One stiffness value trades floppy for stiff
- In this rapier.js version, only revolute and prismatic joints have motors in the JS API (ball-joint motors are commented out). So my rig only bends in one plane
- It can't take a step, so a hard enough hit still knocks it down
- Every value is tuned for one body. Change the masses and you retune
▸ When to use it
Melee and physics games where hits should look different every time, and the character has to stay on its feet without an animator authoring each reaction.
if you want to follow the playground: kethdev.itch.io/jeve-playgro…
keth retweeted
Picanha: 58,90
Leite: 4,39
Gasolina: 4,79
Dólar: 5,29
Estes são os preços de hoje, favoritem aqui para daqui a algum tempo a gente comparar se esse “herói”, eleito, fez por merecer o comando do país.
Atualizado 31/12/22
keth retweeted
Beethoven’s music is actively bad. He writes a dominant chord, knowing we will anticipate a tonic resolution, only to purposefully deceive his listeners when he resolves to the minor submediant, (1/363)













