highfidelity/hifi — pull request #3295 by AndrewMeadows (2014-08-18 21:03:29+00:00)
Title: Ragdoll Part 11: ragdoll collisions move avatar

Each Ragdoll's root VerletPoint used to be constrained to stay in one spot within the simulation using a FixedConstraint that was enforced after all the other constraints. This would make it very hard to actualy _move_ a Ragdoll during collisions.

The FixedConstraint has been removed and instead we set the mass of each Ragdoll's root VerletPoint to be the sum total mass of all the joints in the Ragdoll, which makes it hard to move when resolving collisions and constraints with lighter points. Then at the end of the simulation step we measure the total offset of the root point from the target position of the Ragdoll, store it in an accumulator, and shift all points back so that the Ragdoll is restored to its original position in the simulation.

The accumulated offset of the entire Ragdoll can be harvested by the owner and used as it sees fit. Specifically MyAvatar extracts the accumulated offset and uses it to decide where to move itself, dragging its Ragdoll with it.