What VIP3R says is correct - What I do is to have a reference position that is always used to create the joints - once the joints are attached in the reference position ensuring that joint limit angles are correct,you can then rotate/postion the bodies to the desired position with dbodySetRotation/dbodySetPosition.
As long as the 'desired' position is not beyond the joint limits it should work fine. If the desired position is beyond a joints limit then the joint will snap to whatever its limit value is.
The process I use is:
Create rag-doll using the reference values ( this is usually frame 0 in an animated model.
Attach joints (except those attached to world)- this makes sure my limits are correct.
Position and Rotate all geoms/bodies to current position.
Attach joints fixed to world (if any).
As long as the 'desired' position is not beyond the joint limits it should work fine. If the desired position is beyond a joints limit then the joint will snap to whatever its limit value is.
The process I use is:
Create rag-doll using the reference values ( this is usually frame 0 in an animated model.
Attach joints (except those attached to world)- this makes sure my limits are correct.
Position and Rotate all geoms/bodies to current position.
Attach joints fixed to world (if any).