usdrt::UsdPhysicsMeshCollisionAPI

Defined in usdrt/scenegraph/usd/usdPhysics/meshCollisionAPI.h

Functions

Variables

class UsdPhysicsMeshCollisionAPI : public usdrt::UsdAPISchemaBase

Attributes to control how a Mesh is made into a collider. Can be applied to only a USDGeomMesh in addition to its PhysicsCollisionAPI. 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 UsdPhysicsMeshCollisionAPI(const UsdPrim &prim = UsdPrim())

Construct a UsdPhysicsMeshCollisionAPI on UsdPrim prim. Equivalent to UsdPhysicsMeshCollisionAPI::Get(prim.GetStage(), prim.GetPath()) for a valid prim , but will not immediately throw an error for an invalid prim.

inline explicit UsdPhysicsMeshCollisionAPI(const UsdSchemaBase &schemaObj)

Construct a UsdPhysicsMeshCollisionAPI on the prim held by schemaObj . Should be preferred over UsdPhysicsMeshCollisionAPI(schemaObj.GetPrim()), as it preserves SchemaBase state.

inline virtual ~UsdPhysicsMeshCollisionAPI()

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 GetApproximationAttr() const

Determines the mesh’s collision approximation: “none” - The mesh geometry is used directly as a collider without any approximation. “convexDecomposition” - A convex mesh decomposition is performed. This results in a set of convex mesh colliders. “convexHull” - A convex hull of the mesh is generated and used as the collider. “boundingSphere” - A bounding sphere is computed around the mesh and used as a collider. “boundingCube” - An optimally fitting box collider is computed around the mesh. “meshSimplification” - A mesh simplification step is performed, resulting in a simplified triangle mesh collider.

Declaration

uniform token physics:approximation = "none"

C++ Type

TfToken

Usd Type

SdfValueTypeNames->Token

Variability

SdfVariabilityUniform

Allowed Values

none, convexDecomposition, convexHull, boundingSphere, boundingCube,

meshSimplification |

inline UsdAttribute CreateApproximationAttr() const

See GetApproximationAttr(), 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) if writeSparsely is true - the default for writeSparsely is false.

UsdPrim GetPrim() const

Return this schema object’s held prim.

SdfPath GetPath() const

Return the SdfPath to this schema object’s held prim.

Public Static Functions

static inline UsdPhysicsMeshCollisionAPI Apply(const UsdPrim &prim)

Applies this single-apply API schema to the given prim. This information is stored by adding “PhysicsMeshCollisionAPI” 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 UsdPhysicsMeshCollisionAPI object is returned upon success. An invalid (or empty) UsdPhysicsMeshCollisionAPI 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

Protected Functions

inline const TfToken &_GetInstanceName() const

Returns the instance name of the API schema object belonging to a multiple-apply API schema.

The returned instance name will be empty for non-applied and single-apply API schemas.