definePhysicsSphericalJoint#

Fully qualified name: usdex::core::definePhysicsSphericalJoint

pxr::UsdPhysicsSphericalJoint usdex::core::definePhysicsSphericalJoint(
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> coneAngle0Limit = std::nullopt,
std::optional<float> coneAngle1Limit = std::nullopt,
)#

Creates a spherical joint, which acts as a ball and socket joint, connecting two rigid bodies.

Using the coordinate system specified by the jointFrame, the local position and rotation corresponding to body0 and body1 of the joint are automatically calculated.

The axis specifies the primary axis for rotation, based on the local joint orientation relative to each body.

  • To rotate around the X-axis, specify (1, 0, 0). To rotate in the opposite direction, specify (-1, 0, 0).

  • To rotate around the Y-axis, specify (0, 1, 0). To rotate in the opposite direction, specify (0, -1, 0).

  • To rotate around the Z-axis, specify (0, 0, 1). To rotate in the opposite direction, specify (0, 0, -1).

  • Any other direction will be aligned to X-axis via a local rotation for both bodies.

For SphericalJoint, the axis specified here is used as the center, and the horizontal and vertical cone angles are limited by coneAngle0Limit and coneAngle1Limit.

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.

  • coneAngle0Limit – The lower limit of the cone angle (degrees).

  • coneAngle1Limit – The upper limit of the cone angle (degrees).

Returns:

UsdPhysicsSphericalJoint schema wrapping the defined UsdPrim