Imagine a game with an astronaut that is directly controlled by a players pose. If the player now rotates their arm from the waist to the head, a rotation of the whole body in the opposite direction would be the result. Alternatively think about a sprinter which is controlled by the players pose. The player extends one of their legs. What would be the resulting force to the ground or velocity of the sprinter?

How do I calculate the resulting force to the whole body?

For the sake of specifity, you can assume Unity with rigidbody physics, but I'm having a problem of understanding if a rigidbody game engine can even be used to inversely calculate forces from pose changes of a kinematic character.

  • \$\begingroup\$ Usually for this kind of thing I use non-kinematic bodies for the limbs, and I calculate the velocity/angular velocity needed for them to reach the current detected pose in one time step, then apply a velocity change to make them move that way. The physics engine can then figure out the impulses on anything they collide with based on those velocities. \$\endgroup\$ – DMGregory Aug 1 '20 at 22:50
  • \$\begingroup\$ Thanks for the tip @DMGregory. But I have a hard time calculating the necessary forces for limbs with more than one joint. How would you calculate force for the astronaut example if the astronaut has something heavy in their hand and uses both shoulder and elbow joints? \$\endgroup\$ – Pascal Aug 7 '20 at 20:56
  • \$\begingroup\$ Step 1: Forget it's an astronaut. Just think of it as a collection of floating rods. Each rod has a place and an orientation it wants to attain. The fact that all those positions and orientations, taken together, make a human form, is coincidental as far as the math is concerned. As long as you source those positions from the player's human form, all you have to do is match that outcome, not concern yourself with the biomechanical details that hold the player's body together. \$\endgroup\$ – DMGregory Aug 7 '20 at 20:58
  • \$\begingroup\$ Ok, then how would you then calculate the force for the upper arm stick to which the lower arm stick is connected? In the rigidbody the force to the upper arm stick would transfer to the lower arm stick so I suppose this cannot be directly calculated with ignoring the lower arm stick. Am I wrong? \$\endgroup\$ – Pascal Aug 10 '20 at 14:19
  • \$\begingroup\$ Don't connect them. The player's limbs are already connected, so you don't need to duplicate that connection in your physics sim. Let the real world physics figure out how to resolve that joint, and just move your individual virtual limb objects to occupy the same positions/orientations. If you match it right, the joints will match up too, without you ever needing to simulate a joint constraint. \$\endgroup\$ – DMGregory Aug 10 '20 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.