All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
materialAPI.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_MATERIALAPI_H
8#define USDPHYSICS_GENERATED_MATERIALAPI_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// PHYSICSMATERIALAPI //
34// -------------------------------------------------------------------------- //
35
43{
44public:
48 static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
49
54 explicit UsdPhysicsMaterialAPI(const UsdPrim& prim=UsdPrim())
55 : UsdAPISchemaBase(prim)
56 {
57 }
58
62 explicit UsdPhysicsMaterialAPI(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
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 // DYNAMICFRICTION
153 // --------------------------------------------------------------------- //
161 USDPHYSICS_API
163
169 USDPHYSICS_API
170 UsdAttribute CreateDynamicFrictionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
171
172public:
173 // --------------------------------------------------------------------- //
174 // STATICFRICTION
175 // --------------------------------------------------------------------- //
183 USDPHYSICS_API
185
191 USDPHYSICS_API
192 UsdAttribute CreateStaticFrictionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
193
194public:
195 // --------------------------------------------------------------------- //
196 // RESTITUTION
197 // --------------------------------------------------------------------- //
205 USDPHYSICS_API
207
213 USDPHYSICS_API
214 UsdAttribute CreateRestitutionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
215
216public:
217 // --------------------------------------------------------------------- //
218 // DENSITY
219 // --------------------------------------------------------------------- //
230 USDPHYSICS_API
232
238 USDPHYSICS_API
239 UsdAttribute CreateDensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
240
241public:
242 // ===================================================================== //
243 // Feel free to add custom code below this line, it will be preserved by
244 // the code generator.
245 //
246 // Just remember to:
247 // - Close the class declaration with };
248 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
249 // - Close the include guard with #endif
250 // ===================================================================== //
251 // --(BEGIN CUSTOM CODE)--
252};
253
254PXR_NAMESPACE_CLOSE_SCOPE
255
256#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
Adds simulation material properties to a Material.
Definition: materialAPI.h:43
UsdPhysicsMaterialAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdPhysicsMaterialAPI on UsdPrim prim .
Definition: materialAPI.h:54
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 const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: materialAPI.h:48
UsdPhysicsMaterialAPI(const UsdSchemaBase &schemaObj)
Construct a UsdPhysicsMaterialAPI on the prim held by schemaObj .
Definition: materialAPI.h:62
USDPHYSICS_API UsdAttribute GetStaticFrictionAttr() const
Static friction coefficient.
USDPHYSICS_API UsdAttribute CreateStaticFrictionAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetStaticFrictionAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDPHYSICS_API UsdAttribute GetDynamicFrictionAttr() const
Dynamic friction coefficient.
USDPHYSICS_API UsdAttribute CreateDynamicFrictionAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetDynamicFrictionAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
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.
virtual USDPHYSICS_API ~UsdPhysicsMaterialAPI()
Destructor.
static USDPHYSICS_API UsdPhysicsMaterialAPI Apply(const UsdPrim &prim)
Applies this single-apply API schema to the given prim.
USDPHYSICS_API UsdAttribute GetRestitutionAttr() const
Restitution coefficient.
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...
USDPHYSICS_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
static USDPHYSICS_API UsdPhysicsMaterialAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdPhysicsMaterialAPI holding the prim adhering to this schema at path on stage.
USDPHYSICS_API UsdAttribute CreateRestitutionAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetRestitutionAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDPHYSICS_API UsdAttribute GetDensityAttr() const
If non-zero, defines the density of the material.
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