I’m working with a custom ragdoll formed by configurable joints and I NEED apply a specyfic torque in some joints. I have calculated this torque, but unfortunately, physx only allow set velocity or angle targets, can integrate this values, or its possible apply this torque directlyu to both attached bodies?
Any can help me? Some ideas?
Sorry for my english, I hope you can understand this post
You have several alternatives. Although most of the time, you will get torque as a consequence. I assume rigidbody.AddTorque doesnt work for what you want. But since you mentioned, that you already computed the torque, you probably already have the data necessary to use this function:
rigidbody.AddForceAtPosition()
which will give you torque as consequence of joints. Otherwise, rigidbody.AddTorque() should just do it for you.
When you say torque on joints, do you mean applying forces to rigidbodies at there joints?
I want to make a joint turn, and therefore, It will be produce torque.
I’m programming a pd controller for a robot simulation. I have some examples with ODE which calculate torque and use methods such as dJointAddUniversalTorques or dJointAddHingeTorque in order to make the limbs turn and produce robot movement.
like you wrote, this is the correct way to do this: Apply this torque in the attached point of body A and (-torque) in body B. it’s correct?
to simulate the ODE function for hinge, call AddTorque twice, once for each rigidbody, using the hinge joint as your axis
you will need to apply +force in one direction for the first rigidbody and then apply the -force (opposite direction) to the other rigidbody
the universal joints are more complicated, i would need to read more about how to do it correctly (maybe the same as above, since these joints are really to hinges close together)