This should be easy but for the life of me I can’t get it to work. I am setting up a ragdoll articulation using data I have created by hand. I can set up all the capsules and joints correctly up to the point where I need to set constraints on the joints so that limbs flex appropriately. I want to set up springs at the joints so that joints stay in the positions they are initialized in when the ragdoll becomes active. I assume I need to call setTargetOrientation() the rotation I want the joint to be at rest. But I cannot work out how to calculate the correct rotation to do this.
The manual is rather vague in this regard and simply says the rotation is relative to the parent frame. I would have thought that setting target orientation to the same rotation I used when I set up the joint would do the job, but it doesn’t. I’ve tried using the rotation of the child relative to the parent, that doesn’t work, I tried using the rotation of the parent relative to the child which also doesn’t work.
Is there something I am missing here? Any help would be much appreciated.