All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
43{
44public:
48 static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
49
54 explicit UsdPhysicsMassAPI(const UsdPrim& prim=UsdPrim())
55 : UsdAPISchemaBase(prim)
56 {
57 }
58
62 explicit UsdPhysicsMassAPI(const UsdSchemaBase& schemaObj)
63 : UsdAPISchemaBase(schemaObj)
64 {
65 }
66
68 USDPHYSICS_API
70
74 USDPHYSICS_API
75 static const TfTokenVector &
76 GetSchemaAttributeNames(bool includeInherited=true);
77
87 USDPHYSICS_API
89 Get(const UsdStagePtr &stage, const SdfPath &path);
90
91
108 USDPHYSICS_API
109 static bool
110 CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
111
127 USDPHYSICS_API
128 static UsdPhysicsMassAPI
129 Apply(const UsdPrim &prim);
130
131protected:
135 USDPHYSICS_API
137
138private:
139 // needs to invoke _GetStaticTfType.
140 friend class UsdSchemaRegistry;
141 USDPHYSICS_API
142 static const TfType &_GetStaticTfType();
143
144 static bool _IsTypedSchema();
145
146 // override SchemaBase virtuals.
147 USDPHYSICS_API
148 const TfType &_GetTfType() const override;
149
150public:
151 // --------------------------------------------------------------------- //
152 // MASS
153 // --------------------------------------------------------------------- //
169 USDPHYSICS_API
171
177 USDPHYSICS_API
178 UsdAttribute CreateMassAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
179
180public:
181 // --------------------------------------------------------------------- //
182 // DENSITY
183 // --------------------------------------------------------------------- //
202 USDPHYSICS_API
204
210 USDPHYSICS_API
211 UsdAttribute CreateDensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
212
213public:
214 // --------------------------------------------------------------------- //
215 // CENTEROFMASS
216 // --------------------------------------------------------------------- //
224 USDPHYSICS_API
226
232 USDPHYSICS_API
233 UsdAttribute CreateCenterOfMassAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
234
235public:
236 // --------------------------------------------------------------------- //
237 // DIAGONALINERTIA
238 // --------------------------------------------------------------------- //
248 USDPHYSICS_API
250
256 USDPHYSICS_API
257 UsdAttribute CreateDiagonalInertiaAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
258
259public:
260 // --------------------------------------------------------------------- //
261 // PRINCIPALAXES
262 // --------------------------------------------------------------------- //
271 USDPHYSICS_API
273
279 USDPHYSICS_API
280 UsdAttribute CreatePrincipalAxesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
281
282public:
283 // ===================================================================== //
284 // Feel free to add custom code below this line, it will be preserved by
285 // the code generator.
286 //
287 // Just remember to:
288 // - Close the class declaration with };
289 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
290 // - Close the include guard with #endif
291 // ===================================================================== //
292 // --(BEGIN CUSTOM CODE)--
293
294};
295
296PXR_NAMESPACE_CLOSE_SCOPE
297
298#endif
Contains an asset path and an optional resolved path.
Definition: assetPath.h:30
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
TfType represents a dynamic runtime type.
Definition: type.h:48
The base class for all API schemas.
Definition: apiSchemaBase.h:99
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:160
Defines explicit mass properties (mass, density, inertia etc.).
Definition: massAPI.h:43
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:48
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:54
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:62
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:147
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
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:440