usdrt::UsdPhysicsDriveAPI
Defined in usdrt/scenegraph/usd/usdPhysics/driveAPI.h
Functions
usdrt::UsdPhysicsDriveAPI::Apply: Applies this multiple-apply API schema to the given
prim
along with the given instance name,name
.usdrt::UsdPhysicsDriveAPI::CreateDampingAttr: See GetDampingAttr() , and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute's default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.usdrt::UsdPhysicsDriveAPI::CreateMaxForceAttr: See GetMaxForceAttr() , and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute's default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.usdrt::UsdPhysicsDriveAPI::CreateStiffnessAttr: See GetStiffnessAttr() , and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute's default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.usdrt::UsdPhysicsDriveAPI::CreateTargetPositionAttr: See GetTargetPositionAttr() , and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute's default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.usdrt::UsdPhysicsDriveAPI::CreateTargetVelocityAttr: See GetTargetVelocityAttr() , and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute's default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.usdrt::UsdPhysicsDriveAPI::CreateTypeAttr: See GetTypeAttr() , and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute's default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.usdrt::UsdPhysicsDriveAPI::GetDampingAttr: Damping of the drive. Units: if linear drive: mass/second If angular drive: mass*DIST_UNITS*DIST_UNITS/second/second/degrees.
usdrt::UsdPhysicsDriveAPI::GetMaxForceAttr: Maximum force that can be applied to drive. Units: if linear drive: mass*DIST_UNITS/second/second if angular drive: mass*DIST_UNITS*DIST_UNITS/second/second inf means not limited. Must be non-negative.
usdrt::UsdPhysicsDriveAPI::GetName: Returns the name of this multiple-apply schema instance.
usdrt::DestructionSchemaDestructibleBaseAPI::GetPath: Return the SdfPath to this schema object's held prim.
usdrt::DestructionSchemaDestructibleBaseAPI::GetPrim: Return this schema object's held prim.
usdrt::UsdPhysicsDriveAPI::GetStiffnessAttr: Stiffness of the drive. Units: if linear drive: mass/second/second if angular drive: mass*DIST_UNITS*DIST_UNITS/degree/second/second.
usdrt::UsdPhysicsDriveAPI::GetTargetPositionAttr: Target value for position. Units: if linear drive: distance if angular drive: degrees.
usdrt::UsdPhysicsDriveAPI::GetTargetVelocityAttr: Target value for velocity. Units: if linear drive: distance/second if angular drive: degrees/second.
usdrt::UsdPhysicsDriveAPI::GetTypeAttr: Drive spring is for the acceleration at the joint (rather than the force).
usdrt::UsdPhysicsDriveAPI::UsdPhysicsDriveAPI: Construct a UsdPhysicsDriveAPI on the prim held by
schemaObj
with namename
. Should be preferred over UsdPhysicsDriveAPI (schemaObj.GetPrim(), name), as it preserves SchemaBase state.usdrt::UsdPhysicsDriveAPI::UsdPhysicsDriveAPI: Construct a UsdPhysicsDriveAPI on UsdPrim
prim
with namename
. Equivalent to UsdPhysicsDriveAPI::Get( prim.GetStage(), prim.GetPath().AppendProperty( "drive:name"));.usdrt::DestructionSchemaDestructibleBaseAPI::_GetInstanceName: Returns the instance name of the API schema object belonging to a multiple-apply API schema.
usdrt::UsdPhysicsDriveAPI::operator bool: Boolean operator.
usdrt::UsdPhysicsDriveAPI::~UsdPhysicsDriveAPI: Destructor.
Variables
usdrt::UsdPhysicsDriveAPI::schemaType: Compile time constant representing what kind of schema this class is.
-
class UsdPhysicsDriveAPI : public usdrt::UsdAPISchemaBase
The PhysicsDriveAPI when applied to any joint primitive will drive the joint towards a given target. The PhysicsDriveAPI is a multipleApply schema: drive can be set per axis “transX”, “transY”, “transZ”, “rotX”, “rotY”, “rotZ” or its “linear” for prismatic joint or “angular” for revolute joints. Setting these as a multipleApply schema TfToken name will define the degree of freedom the DriveAPI is applied to. Each drive is an implicit force-limited damped spring: Force or acceleration = stiffness * (targetPosition - position)
damping * (targetVelocity - velocity) For any described attribute Fallback Value or Allowed Values below that are text/tokens, the actual token is published and defined in UsdPhysicsTokens. So to set an attribute to the value “rightHanded”, use UsdPhysicsTokens->rightHanded as the value.
Public Functions
-
inline explicit UsdPhysicsDriveAPI(const UsdPrim &prim = UsdPrim(), const TfToken &name = TfToken())
Construct a UsdPhysicsDriveAPI on UsdPrim
prim
with namename
. Equivalent to UsdPhysicsDriveAPI::Get( prim.GetStage(), prim.GetPath().AppendProperty( “drive:name”));.for a valid
prim
, but will not immediately throw an error for an invalidprim
-
inline explicit UsdPhysicsDriveAPI(const UsdSchemaBase &schemaObj, const TfToken &name)
Construct a UsdPhysicsDriveAPI on the prim held by
schemaObj
with namename
. Should be preferred over UsdPhysicsDriveAPI(schemaObj.GetPrim(), name), as it preserves SchemaBase state.
-
inline virtual ~UsdPhysicsDriveAPI()
Destructor.
-
inline operator bool() const
Boolean operator.
- Returns
Return true if the contained prim is has this api schema applied using
HasAPI
, and false otherwise.
-
inline UsdAttribute GetTypeAttr() const
Drive spring is for the acceleration at the joint (rather than the force).
Declaration
uniform token physics:type = "force"
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
force, acceleration
-
inline UsdAttribute CreateTypeAttr() const
See GetTypeAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute’s default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
inline UsdAttribute GetMaxForceAttr() const
Maximum force that can be applied to drive. Units: if linear drive: mass*DIST_UNITS/second/second if angular drive: mass*DIST_UNITS*DIST_UNITS/second/second inf means not limited. Must be non-negative.
Declaration
float physics:maxForce = inf
C++ Type
float
Usd Type
SdfValueTypeNames->Float
-
inline UsdAttribute CreateMaxForceAttr() const
See GetMaxForceAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute’s default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
inline UsdAttribute GetTargetPositionAttr() const
Target value for position. Units: if linear drive: distance if angular drive: degrees.
Declaration
float physics:targetPosition = 0
C++ Type
float
Usd Type
SdfValueTypeNames->Float
-
inline UsdAttribute CreateTargetPositionAttr() const
See GetTargetPositionAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute’s default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
inline UsdAttribute GetTargetVelocityAttr() const
Target value for velocity. Units: if linear drive: distance/second if angular drive: degrees/second.
Declaration
float physics:targetVelocity = 0
C++ Type
float
Usd Type
SdfValueTypeNames->Float
-
inline UsdAttribute CreateTargetVelocityAttr() const
See GetTargetVelocityAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute’s default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
inline UsdAttribute GetDampingAttr() const
Damping of the drive. Units: if linear drive: mass/second If angular drive: mass*DIST_UNITS*DIST_UNITS/second/second/degrees.
Declaration
float physics:damping = 0
C++ Type
float
Usd Type
SdfValueTypeNames->Float
-
inline UsdAttribute CreateDampingAttr() const
See GetDampingAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute’s default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
inline UsdAttribute GetStiffnessAttr() const
Stiffness of the drive. Units: if linear drive: mass/second/second if angular drive: mass*DIST_UNITS*DIST_UNITS/degree/second/second.
Declaration
float physics:stiffness = 0
C++ Type
float
Usd Type
SdfValueTypeNames->Float
-
inline UsdAttribute CreateStiffnessAttr() const
See GetStiffnessAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute’s default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
Public Static Functions
-
static inline UsdPhysicsDriveAPI Apply(const UsdPrim &prim, const TfToken &name)
Applies this multiple-apply API schema to the given
prim
along with the given instance name,name
.This information is stored by adding “PhysicsDriveAPI:<i>name</i>” to the token-valued, listOp metadata apiSchemas on the prim. For example, if
name
is ‘instance1’, the token ‘PhysicsDriveAPI:instance1’ is added to ‘apiSchemas’.See also
UsdPrim::GetAppliedSchemas()
See also
UsdPrim::HasAPI()
See also
UsdPrim::ApplyAPI()
See also
UsdPrim::RemoveAPI()
- Returns
A valid UsdPhysicsDriveAPI object is returned upon success. An invalid (or empty) UsdPhysicsDriveAPI object is returned upon failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
Public Static Attributes
-
static const UsdSchemaType schemaType = UsdSchemaType::MultipleApplyAPI
Compile time constant representing what kind of schema this class is.
See also
UsdSchemaType