Loading...
Searching...
No Matches
massAPI.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef USDPHYSICS_GENERATED_MASSAPI_H
8#define USDPHYSICS_GENERATED_MASSAPI_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdPhysics/api.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
18
19#include "pxr/base/vt/value.h"
20
21#include "pxr/base/gf/vec3d.h"
22#include "pxr/base/gf/vec3f.h"
24
25#include "pxr/base/tf/token.h"
26#include "pxr/base/tf/type.h"
27
28PXR_NAMESPACE_OPEN_SCOPE
29
30class SdfAssetPath;
31
32// -------------------------------------------------------------------------- //
33// PHYSICSMASSAPI //
34// -------------------------------------------------------------------------- //
35
50{
51public:
56
61 explicit UsdPhysicsMassAPI(const UsdPrim& prim=UsdPrim())
62 : UsdAPISchemaBase(prim)
63 {
64 }
65
69 explicit UsdPhysicsMassAPI(const UsdSchemaBase& schemaObj)
70 : UsdAPISchemaBase(schemaObj)
71 {
72 }
73
75 USDPHYSICS_API
77
81 USDPHYSICS_API
82 static const TfTokenVector &
83 GetSchemaAttributeNames(bool includeInherited=true);
84
94 USDPHYSICS_API
96 Get(const UsdStagePtr &stage, const SdfPath &path);
97
98
115 USDPHYSICS_API
116 static bool
117 CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
118
134 USDPHYSICS_API
135 static UsdPhysicsMassAPI
136 Apply(const UsdPrim &prim);
137
138protected:
142 USDPHYSICS_API
144
145private:
146 // needs to invoke _GetStaticTfType.
147 friend class UsdSchemaRegistry;
148 USDPHYSICS_API
149 static const TfType &_GetStaticTfType();
150
151 static bool _IsTypedSchema();
152
153 // override SchemaBase virtuals.
154 USDPHYSICS_API
155 const TfType &_GetTfType() const override;
156
157public:
158 // --------------------------------------------------------------------- //
159 // MASS
160 // --------------------------------------------------------------------- //
176 USDPHYSICS_API
178
184 USDPHYSICS_API
185 UsdAttribute CreateMassAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
186
187public:
188 // --------------------------------------------------------------------- //
189 // DENSITY
190 // --------------------------------------------------------------------- //
209 USDPHYSICS_API
211
217 USDPHYSICS_API
218 UsdAttribute CreateDensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
219
220public:
221 // --------------------------------------------------------------------- //
222 // CENTEROFMASS
223 // --------------------------------------------------------------------- //
231 USDPHYSICS_API
233
239 USDPHYSICS_API
240 UsdAttribute CreateCenterOfMassAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
241
242public:
243 // --------------------------------------------------------------------- //
244 // DIAGONALINERTIA
245 // --------------------------------------------------------------------- //
255 USDPHYSICS_API
257
263 USDPHYSICS_API
264 UsdAttribute CreateDiagonalInertiaAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
265
266public:
267 // --------------------------------------------------------------------- //
268 // PRINCIPALAXES
269 // --------------------------------------------------------------------- //
278 USDPHYSICS_API
280
286 USDPHYSICS_API
287 UsdAttribute CreatePrincipalAxesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
288
289public:
290 // ===================================================================== //
291 // Feel free to add custom code below this line, it will be preserved by
292 // the code generator.
293 //
294 // Just remember to:
295 // - Close the class declaration with };
296 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
297 // - Close the include guard with #endif
298 // ===================================================================== //
299 // --(BEGIN CUSTOM CODE)--
300
301};
302
303PXR_NAMESPACE_CLOSE_SCOPE
304
305#endif
Contains an asset path and optional evaluated and resolved paths.
Definition assetPath.h:79
A path value used to locate objects in layers or scenegraphs.
Definition path.h:281
TfType represents a dynamic runtime type.
Definition type.h:48
The base class for all API schemas.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition attribute.h:183
Defines explicit mass properties (mass, density, inertia etc.).
Definition massAPI.h:50
static USDPHYSICS_API bool CanApply(const UsdPrim &prim, std::string *whyNot=nullptr)
Returns true if this single-apply API schema can be applied to the given prim.
static USDPHYSICS_API UsdPhysicsMassAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdPhysicsMassAPI holding the prim adhering to this schema at path on stage.
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition massAPI.h:55
USDPHYSICS_API UsdAttribute GetDiagonalInertiaAttr() const
If non-zero, specifies diagonalized inertia tensor along the principal axes.
USDPHYSICS_API UsdAttribute GetCenterOfMassAttr() const
Center of mass in the prim's local space.
USDPHYSICS_API UsdAttribute CreateCenterOfMassAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetCenterOfMassAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDPHYSICS_API UsdAttribute GetPrincipalAxesAttr() const
Orientation of the inertia tensor's principal axes in the prim's local space.
UsdPhysicsMassAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdPhysicsMassAPI on UsdPrim prim .
Definition massAPI.h:61
USDPHYSICS_API UsdAttribute CreateDiagonalInertiaAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetDiagonalInertiaAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDPHYSICS_API UsdAttribute CreateMassAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetMassAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
static USDPHYSICS_API UsdPhysicsMassAPI Apply(const UsdPrim &prim)
Applies this single-apply API schema to the given prim.
UsdPhysicsMassAPI(const UsdSchemaBase &schemaObj)
Construct a UsdPhysicsMassAPI on the prim held by schemaObj .
Definition massAPI.h:69
USDPHYSICS_API UsdAttribute GetMassAttr() const
If non-zero, directly specifies the mass of the object.
USDPHYSICS_API UsdAttribute CreateDensityAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetDensityAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDPHYSICS_API UsdAttribute CreatePrincipalAxesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetPrincipalAxesAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
static USDPHYSICS_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
virtual USDPHYSICS_API ~UsdPhysicsMassAPI()
Destructor.
USDPHYSICS_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
USDPHYSICS_API UsdAttribute GetDensityAttr() const
If non-zero, specifies the density of the object.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition prim.h:117
The base class for all schema types in Usd.
Definition schemaBase.h:39
Singleton registry that provides access to schema type information and the prim definitions for regis...
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition value.h:90
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition common.h:112
@ SingleApplyAPI
Single Apply API schema.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition token.h:489