I tried building a sort of active ragdoll, but realized there is no way in the engine to apply torque off objects origin, at a pin joint for example.
If I only needed one point of rotation I could place origin at the pin, but for a ragdoll a body may be connected with two (or more) joints. If I want those joints to be powered and act correctly I need a way to apply torque at their position. Is there any recipes|examples on how to apply torque to a rigid body at arbitrary point?
To apply torque off center
Asked Answered
So torque is going to rotate around the center of mass, it doesn't really make sense for it to be at another point.
However, you can apply an impulse, which at the right position would cause a rotation.
Gober Are there examples around of how to calculate the impulse from a given torque? I tried looking but found nothing useful.
Edit: Actually, it looks like the apply_impulse alters the linear velocity disregarding the point the impulse is applied at, which I think is incorrect. I might need to calculate linear and angular acceleration directly instead.
© 2022 - 2024 — McMap. All rights reserved.