pub unsafe extern "C" fn PxArticulationJointReducedCoordinate_setJointPosition_mut(
    self_: *mut PxArticulationJointReducedCoordinate,
    axis: PxArticulationAxis,
    jointPos: f32
)
Expand description

Sets the joint position for the given axis.

  • For performance, prefer PxArticulationCache::jointPosition to set joint positions in a batch articulation state update.
  • Use PxArticulationReducedCoordinate::updateKinematic after all state updates to the articulation via non-cache API such as this method, in order to update link states for the next simulation frame or querying.

This call is not allowed while the simulation is running.

For spherical joints, jointPos must be in range [-Pi, Pi].

Joint position is specified in the parent frame of the joint. If Gp, Gc are the parent and child actor poses in the world frame and Lp, Lc are the parent and child joint frames expressed in the parent and child actor frames then the parent and child links will be given poses that obey Gp * Lp * J = Gc * Lc with J denoting the joint pose. For joints restricted to angular motion, J has the form PxTranfsorm(PxVec3(PxZero), PxExp(PxVec3(twistPos, swing1Pos, swing2Pos))). For joints restricted to linear motion, J has the form PxTransform(PxVec3(xPos, yPos, zPos), PxQuat(PxIdentity)).

For spherical joints with more than 1 degree of freedom, the input joint positions taken together can collectively represent a rotation of greater than Pi around a vector. When this happens the rotation that matches the joint positions is not the shortest path rotation. The joint pose J that is the outcome of setting and applying the joint positions will always be the equivalent of the shortest path rotation.