how to set target orientation for joints in an articulation

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.

Hi again.

I still can’t get this to work. There doesn’t seem to be any documentation demonstrating how to do this. Can anyone point me in the right direction please?

I’m really getting desperate with this. Two possibilities come to mind: this a stupid question and I’m missing the obvious or no on reading this has an answer?

Seems like the sort of thing which should be easy to do and should be explained in the documentation…

Maybe if I rephrase the question. I want to set up a joint so that the rest position is the same as the starting orientation of the joint. So that when I start the simulation my model doesn’t curl up into a ball when I turn on constraints…

I’m thinking that I should abandon my attempts to use articulations and make my ragdoll out of actors and joints. I’m not sure if this will solve the problem but it seems that there is quite a bit more documentation supporting this option and the documentation does mention that articulations are experimental so maybe my problem is a result of bugs in that rather than problems with my code.