JoltC_RagdollSettings_SetPartToParent takes a const JoltC_TwoBodyConstraintSettings*, and nothing in any JoltC header produces one. Grepping include/ finds the type exactly twice: the opaque typedef in common.h and this one parameter.
So NULL is the only value a C caller can pass, mToParent is never assigned, and every JoltC ragdoll is a collection of unconnected rigid bodies with zero constraints.
Why it matters now
JoltPhysics 5.6.0 adds Ragdoll::DriveToPoseUsingMotors and EMotorState::PositionAndVelocity. From C there is currently nothing for either to act on, so that part of the release cannot be exposed until this is closed.
Two consequences worth knowing
RagdollSettings::CreateRagdoll guards p.mToParent != nullptr before bodies[mSkeleton->GetJoint(joint_idx).mParentJointIndex], so the out-of-bounds read on an unresolved -1 parent index is currently unreachable. Closing this gap makes it live, and AddJoint3 deliberately leaves indices at -1.
RagdollSettings::GetConstraintIndexForBodyIndex indexes mBodyIndexToConstraintIndex, which is empty until CalculateBodyIndexToConstraintIndex() is called — and CreateRagdoll does not call it. DriveToPoseUsingMotors calls it internally, so "build that table first" is an undocumented precondition.
Found while writing JoltC/tests/test_skeleton_extra.c, which covers all 82 declared functions and reaches this one only through its null path.
JoltC_RagdollSettings_SetPartToParenttakes aconst JoltC_TwoBodyConstraintSettings*, and nothing in any JoltC header produces one. Greppinginclude/finds the type exactly twice: the opaque typedef incommon.hand this one parameter.So
NULLis the only value a C caller can pass,mToParentis never assigned, and every JoltC ragdoll is a collection of unconnected rigid bodies with zero constraints.Why it matters now
JoltPhysics 5.6.0 adds
Ragdoll::DriveToPoseUsingMotorsandEMotorState::PositionAndVelocity. From C there is currently nothing for either to act on, so that part of the release cannot be exposed until this is closed.Two consequences worth knowing
RagdollSettings::CreateRagdollguardsp.mToParent != nullptrbeforebodies[mSkeleton->GetJoint(joint_idx).mParentJointIndex], so the out-of-bounds read on an unresolved-1parent index is currently unreachable. Closing this gap makes it live, andAddJoint3deliberately leaves indices at-1.RagdollSettings::GetConstraintIndexForBodyIndexindexesmBodyIndexToConstraintIndex, which is empty untilCalculateBodyIndexToConstraintIndex()is called — andCreateRagdolldoes not call it.DriveToPoseUsingMotorscalls it internally, so "build that table first" is an undocumented precondition.Found while writing
JoltC/tests/test_skeleton_extra.c, which covers all 82 declared functions and reaches this one only through its null path.