usdrt::UsdPhysicsMassAPI
Defined in usdrt/scenegraph/usd/usdPhysics/massAPI.h
Functions
usdrt::UsdPhysicsMassAPI::Apply: Applies this single-apply API schema to the given
prim
. This information is stored by adding "PhysicsMassAPI" to the token-valued, listOp metadata apiSchemas on the prim.usdrt::UsdPhysicsMassAPI::CreateCenterOfMassAttr: See GetCenterOfMassAttr() , 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::UsdPhysicsMassAPI::CreateDensityAttr: See GetDensityAttr() , 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::UsdPhysicsMassAPI::CreateDiagonalInertiaAttr: See GetDiagonalInertiaAttr() , 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::UsdPhysicsMassAPI::CreateMassAttr: See GetMassAttr() , 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::UsdPhysicsMassAPI::CreatePrincipalAxesAttr: See GetPrincipalAxesAttr() , 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::UsdPhysicsMassAPI::GetCenterOfMassAttr: Center of mass in the prim's local space. Units: distance.
usdrt::UsdPhysicsMassAPI::GetDensityAttr: If non-zero, specifies the density of the object. In the context of rigid body physics, density indirectly results in setting mass via (mass = density x volume of the object). How the volume is computed is up to implementation of the physics system. It is generally computed from the collision approximation rather than the graphical mesh. In the case where both density and mass are specified for the same object, mass has precedence over density. Unlike mass, child's prim's density overrides parent prim's density as it is accumulative. Note that density of a collisionAPI can be also alternatively set through a PhysicsMaterialAPI. The material density has the weakest precedence in density definition. Note if density is 0.0 it is ignored. Units: mass/distance/distance/distance.
usdrt::UsdPhysicsMassAPI::GetDiagonalInertiaAttr: If non-zero, specifies diagonalized inertia tensor along the principal axes. Note if diagonalInertial is (0.0, 0.0, 0.0) it is ignored. Units: mass*distance*distance.
usdrt::UsdPhysicsMassAPI::GetMassAttr: If non-zero, directly specifies the mass of the object. Note that any child prim can also have a mass when they apply massAPI. In this case, the precedence rule is 'parent mass overrides the child's'. This may come as counter-intuitive, but mass is a computed quantity and in general not accumulative. For example, if a parent has mass of 10, and one of two children has mass of 20, allowing child's mass to override its parent results in a mass of -10 for the other child. Note if mass is 0.0 it is ignored. Units: mass.
usdrt::DestructionSchemaDestructibleBaseAPI::GetPath: Return the SdfPath to this schema object's held prim.
usdrt::DestructionSchemaDestructibleBaseAPI::GetPrim: Return this schema object's held prim.
usdrt::UsdPhysicsMassAPI::GetPrincipalAxesAttr: Orientation of the inertia tensor's principal axes in the prim's local space.
usdrt::UsdPhysicsMassAPI::UsdPhysicsMassAPI: Construct a UsdPhysicsMassAPI on UsdPrim
prim
. Equivalent to UsdPhysicsMassAPI::Get(prim.GetStage(), prim.GetPath()) for a validprim
, but will not immediately throw an error for an invalidprim
.usdrt::UsdPhysicsMassAPI::UsdPhysicsMassAPI: Construct a UsdPhysicsMassAPI on the prim held by
schemaObj
. Should be preferred over UsdPhysicsMassAPI (schemaObj.GetPrim()), as it preserves SchemaBase state.usdrt::DestructionSchemaDestructibleBaseAPI::_GetInstanceName: Returns the instance name of the API schema object belonging to a multiple-apply API schema.
usdrt::UsdPhysicsMassAPI::operator bool: Boolean operator.
usdrt::UsdPhysicsMassAPI::~UsdPhysicsMassAPI: Destructor.
Variables
usdrt::UsdPhysicsMassAPI::schemaType: Compile time constant representing what kind of schema this class is.
-
class UsdPhysicsMassAPI : public usdrt::UsdAPISchemaBase
Defines explicit mass properties (mass, density, inertia etc.). MassAPI can be applied to any object that has a PhysicsCollisionAPI or a PhysicsRigidBodyAPI.
Public Functions
-
inline explicit UsdPhysicsMassAPI(const UsdPrim &prim = UsdPrim())
Construct a UsdPhysicsMassAPI on UsdPrim
prim
. Equivalent to UsdPhysicsMassAPI::Get(prim.GetStage(), prim.GetPath()) for a validprim
, but will not immediately throw an error for an invalidprim
.
-
inline explicit UsdPhysicsMassAPI(const UsdSchemaBase &schemaObj)
Construct a UsdPhysicsMassAPI on the prim held by
schemaObj
. Should be preferred over UsdPhysicsMassAPI(schemaObj.GetPrim()), as it preserves SchemaBase state.
-
inline virtual ~UsdPhysicsMassAPI()
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 GetMassAttr() const
If non-zero, directly specifies the mass of the object. Note that any child prim can also have a mass when they apply massAPI. In this case, the precedence rule is ‘parent mass overrides the child’s’. This may come as counter-intuitive, but mass is a computed quantity and in general not accumulative. For example, if a parent has mass of 10, and one of two children has mass of 20, allowing child’s mass to override its parent results in a mass of -10 for the other child. Note if mass is 0.0 it is ignored. Units: mass.
Declaration
float physics:mass = 0
C++ Type
float
Usd Type
SdfValueTypeNames->Float
-
inline UsdAttribute CreateMassAttr() const
See GetMassAttr(), 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 GetDensityAttr() const
If non-zero, specifies the density of the object. In the context of rigid body physics, density indirectly results in setting mass via (mass = density x volume of the object). How the volume is computed is up to implementation of the physics system. It is generally computed from the collision approximation rather than the graphical mesh. In the case where both density and mass are specified for the same object, mass has precedence over density. Unlike mass, child’s prim’s density overrides parent prim’s density as it is accumulative. Note that density of a collisionAPI can be also alternatively set through a PhysicsMaterialAPI. The material density has the weakest precedence in density definition. Note if density is 0.0 it is ignored. Units: mass/distance/distance/distance.
Declaration
float physics:density = 0
C++ Type
float
Usd Type
SdfValueTypeNames->Float
-
inline UsdAttribute CreateDensityAttr() const
See GetDensityAttr(), 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 GetCenterOfMassAttr() const
Center of mass in the prim’s local space. Units: distance.
Declaration
point3f physics:centerOfMass = (-inf, -inf, -inf)
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Point3f
-
inline UsdAttribute CreateCenterOfMassAttr() const
See GetCenterOfMassAttr(), 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 GetDiagonalInertiaAttr() const
If non-zero, specifies diagonalized inertia tensor along the principal axes. Note if diagonalInertial is (0.0, 0.0, 0.0) it is ignored. Units: mass*distance*distance.
Declaration
float3 physics:diagonalInertia = (0, 0, 0)
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Float3
-
inline UsdAttribute CreateDiagonalInertiaAttr() const
See GetDiagonalInertiaAttr(), 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 GetPrincipalAxesAttr() const
Orientation of the inertia tensor’s principal axes in the prim’s local space.
Declaration
quatf physics:principalAxes = (0, 0, 0, 0)
C++ Type
GfQuatf
Usd Type
SdfValueTypeNames->Quatf
-
inline UsdAttribute CreatePrincipalAxesAttr() const
See GetPrincipalAxesAttr(), 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 UsdPhysicsMassAPI Apply(const UsdPrim &prim)
Applies this single-apply API schema to the given
prim
. This information is stored by adding “PhysicsMassAPI” to the token-valued, listOp metadata apiSchemas on the prim.See also
UsdPrim::GetAppliedSchemas()
See also
UsdPrim::HasAPI()
See also
UsdPrim::ApplyAPI()
See also
UsdPrim::RemoveAPI()
- Returns
A valid UsdPhysicsMassAPI object is returned upon success. An invalid (or empty) UsdPhysicsMassAPI object is returned upon failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
Public Static Attributes
-
static const UsdSchemaType schemaType = UsdSchemaType::SingleApplyAPI
Compile time constant representing what kind of schema this class is.
See also
UsdSchemaType
-
inline explicit UsdPhysicsMassAPI(const UsdPrim &prim = UsdPrim())