definePhysicsPrismaticJoint#
Fully qualified name: usdex::core::definePhysicsPrismaticJoint
- pxr::UsdPhysicsPrismaticJoint usdex::core::definePhysicsPrismaticJoint(
- pxr::UsdStagePtr stage,
- const pxr::SdfPath &path,
- const pxr::UsdPrim &body0,
- const pxr::UsdPrim &body1,
- const JointFrame &frame,
- const pxr::GfVec3f &axis = pxr::GfVec3f(1.0f, 0.0f, 0.0f),
- std::optional<float> lowerLimit = std::nullopt,
- std::optional<float> upperLimit = std::nullopt,
Creates a prismatic joint, which acts as a slider along a single axis, connecting two rigid bodies.
Using the coordinate system specified by the
jointFrame, the local position and rotation corresponding tobody0andbody1of the joint are automatically calculated.The
axisspecifies the primary axis for rotation, based on the local joint orientation relative to each body.To slide along the X-axis, specify (1, 0, 0). To slide in the opposite direction, specify (-1, 0, 0).
To slide along the Y-axis, specify (0, 1, 0). To slide in the opposite direction, specify (0, -1, 0).
To slide along the Z-axis, specify (0, 0, 1). To slide in the opposite direction, specify (0, 0, -1).
Any other direction will be aligned to X-axis via a local rotation for both bodies.
The
lowerLimitandupperLimitare specified as distance along theaxisin linear units of the stage.- Parameters:
stage – The stage on which to define the joint
path – The absolute prim path at which to define the joint
body0 – The first body of the joint
body1 – The second body of the joint
frame – The position and rotation of the joint in the specified coordinate system.
axis – The axis of the joint.
lowerLimit – The lower limit of the joint (distance).
upperLimit – The upper limit of the joint (distance).
- Returns:
UsdPhysicsPrismaticJoint schema wrapping the defined UsdPrim