Physics Joint Prims#
PhysicsJoint Prims define constraints which reduce the degrees of freedom between two bodies.
The PhysicsJoint prims can be thought of as existing in two places at once: relative to each body that they constrain. Properly defining PhysicsJoints relative to both bodies can be arduous, especially given differences in source data specification across maximal coordinate (free-body) and reduced coordinate solvers.
This module simplifies the authoring process and ensures PhysicsJoints are aligned to both bodies, regardless of the source data specification.
Classes Summary#
- usdex::core::JointFrame
Specifies a position and rotation in the coordinate system specified by
space
Functions Summary#
- void usdex::core::alignPhysicsJoint(pxr::UsdPhysicsJoint joint, const JointFrame &frame, const pxr::GfVec3f &axis=pxr::GfVec3f(1.0f, 0.0f, 0.0f))
Aligns an existing joint with the specified position, rotation, and axis.
- void usdex::core::connectPhysicsJoint(pxr::UsdPhysicsJoint joint, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame, const pxr::GfVec3f &axis=pxr::GfVec3f(1.0f, 0.0f, 0.0f))
Connects an existing joint to the specified body prims and realigns the joint frame accordingly.
- pxr::UsdPhysicsFixedJoint usdex::core::definePhysicsFixedJoint(pxr::UsdPrim prim, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame)
Creates a fixed joint connecting two rigid bodies.
- pxr::UsdPhysicsFixedJoint usdex::core::definePhysicsFixedJoint(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame)
Creates a fixed joint connecting two rigid bodies.
- pxr::UsdPhysicsFixedJoint usdex::core::definePhysicsFixedJoint(pxr::UsdPrim parent, const std::string &name, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame)
Creates a fixed joint connecting two rigid bodies.
- pxr::UsdPhysicsPrismaticJoint usdex::core::definePhysicsPrismaticJoint(pxr::UsdPrim parent, const std::string &name, 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.
- pxr::UsdPhysicsPrismaticJoint usdex::core::definePhysicsPrismaticJoint(pxr::UsdPrim prim, 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.
- 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.
- pxr::UsdPhysicsRevoluteJoint usdex::core::definePhysicsRevoluteJoint(pxr::UsdPrim parent, const std::string &name, 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 revolute joint, which acts as a hinge around a single axis, connecting two rigid bodies.
- pxr::UsdPhysicsRevoluteJoint usdex::core::definePhysicsRevoluteJoint(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 revolute joint, which acts as a hinge around a single axis, connecting two rigid bodies.
- pxr::UsdPhysicsRevoluteJoint usdex::core::definePhysicsRevoluteJoint(pxr::UsdPrim prim, 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 revolute joint, which acts as a hinge around a single axis, connecting two rigid bodies.
- pxr::UsdPhysicsSphericalJoint usdex::core::definePhysicsSphericalJoint(pxr::UsdPrim prim, 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.
- pxr::UsdPhysicsSphericalJoint usdex::core::definePhysicsSphericalJoint(pxr::UsdPrim parent, const std::string &name, 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.
- 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.