HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sphericalJoint.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_SPHERICALJOINT_H
8 #define USDPHYSICS_GENERATED_SPHERICALJOINT_H
9 
10 /// \file usdPhysics/sphericalJoint.h
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"
23 #include "pxr/base/gf/matrix4d.h"
24 
25 #include "pxr/base/tf/token.h"
26 #include "pxr/base/tf/type.h"
27 
29 
30 class SdfAssetPath;
31 
32 // -------------------------------------------------------------------------- //
33 // PHYSICSSPHERICALJOINT //
34 // -------------------------------------------------------------------------- //
35 
36 /// \class UsdPhysicsSphericalJoint
37 ///
38 /// Predefined spherical joint type (Removes linear degrees of
39 /// freedom, cone limit may restrict the motion in a given range.) It allows
40 /// two limit values, which when equal create a circular, else an elliptic
41 /// cone limit around the limit axis.
42 ///
43 /// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
44 /// that are text/tokens, the actual token is published and defined in \ref UsdPhysicsTokens.
45 /// So to set an attribute to the value "rightHanded", use UsdPhysicsTokens->rightHanded
46 /// as the value.
47 ///
49 {
50 public:
51  /// Compile time constant representing what kind of schema this class is.
52  ///
53  /// \sa UsdSchemaKind
55 
56  /// Construct a UsdPhysicsSphericalJoint on UsdPrim \p prim .
57  /// Equivalent to UsdPhysicsSphericalJoint::Get(prim.GetStage(), prim.GetPath())
58  /// for a \em valid \p prim, but will not immediately throw an error for
59  /// an invalid \p prim
60  explicit UsdPhysicsSphericalJoint(const UsdPrim& prim=UsdPrim())
61  : UsdPhysicsJoint(prim)
62  {
63  }
64 
65  /// Construct a UsdPhysicsSphericalJoint on the prim held by \p schemaObj .
66  /// Should be preferred over UsdPhysicsSphericalJoint(schemaObj.GetPrim()),
67  /// as it preserves SchemaBase state.
68  explicit UsdPhysicsSphericalJoint(const UsdSchemaBase& schemaObj)
69  : UsdPhysicsJoint(schemaObj)
70  {
71  }
72 
73  /// Destructor.
75  virtual ~UsdPhysicsSphericalJoint();
76 
77  /// Return a vector of names of all pre-declared attributes for this schema
78  /// class and all its ancestor classes. Does not include attributes that
79  /// may be authored by custom/extended methods of the schemas involved.
81  static const TfTokenVector &
82  GetSchemaAttributeNames(bool includeInherited=true);
83 
84  /// Return a UsdPhysicsSphericalJoint holding the prim adhering to this
85  /// schema at \p path on \p stage. If no prim exists at \p path on
86  /// \p stage, or if the prim at that path does not adhere to this schema,
87  /// return an invalid schema object. This is shorthand for the following:
88  ///
89  /// \code
90  /// UsdPhysicsSphericalJoint(stage->GetPrimAtPath(path));
91  /// \endcode
92  ///
95  Get(const UsdStagePtr &stage, const SdfPath &path);
96 
97  /// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
98  /// is defined (according to UsdPrim::IsDefined()) on this stage.
99  ///
100  /// If a prim adhering to this schema at \p path is already defined on this
101  /// stage, return that prim. Otherwise author an \a SdfPrimSpec with
102  /// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
103  /// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
104  /// with \p specifier == \a SdfSpecifierDef and empty typeName at the
105  /// current EditTarget for any nonexistent, or existing but not \a Defined
106  /// ancestors.
107  ///
108  /// The given \a path must be an absolute prim path that does not contain
109  /// any variant selections.
110  ///
111  /// If it is impossible to author any of the necessary PrimSpecs, (for
112  /// example, in case \a path cannot map to the current UsdEditTarget's
113  /// namespace) issue an error and return an invalid \a UsdPrim.
114  ///
115  /// Note that this method may return a defined prim whose typeName does not
116  /// specify this schema class, in case a stronger typeName opinion overrides
117  /// the opinion at the current EditTarget.
118  ///
121  Define(const UsdStagePtr &stage, const SdfPath &path);
122 
123 protected:
124  /// Returns the kind of schema this class belongs to.
125  ///
126  /// \sa UsdSchemaKind
128  UsdSchemaKind _GetSchemaKind() const override;
129 
130 private:
131  // needs to invoke _GetStaticTfType.
132  friend class UsdSchemaRegistry;
134  static const TfType &_GetStaticTfType();
135 
136  static bool _IsTypedSchema();
137 
138  // override SchemaBase virtuals.
140  const TfType &_GetTfType() const override;
141 
142 public:
143  // --------------------------------------------------------------------- //
144  // AXIS
145  // --------------------------------------------------------------------- //
146  /// Cone limit axis.
147  ///
148  /// | ||
149  /// | -- | -- |
150  /// | Declaration | `uniform token physics:axis = "X"` |
151  /// | C++ Type | TfToken |
152  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
153  /// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
154  /// | \ref UsdPhysicsTokens "Allowed Values" | X, Y, Z |
156  UsdAttribute GetAxisAttr() const;
157 
158  /// See GetAxisAttr(), and also
159  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
160  /// If specified, author \p defaultValue as the attribute's default,
161  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
162  /// the default for \p writeSparsely is \c false.
164  UsdAttribute CreateAxisAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
165 
166 public:
167  // --------------------------------------------------------------------- //
168  // CONEANGLE0LIMIT
169  // --------------------------------------------------------------------- //
170  /// Cone limit from the primary joint axis in the local0 frame
171  /// toward the next axis. (Next axis of X is Y, and of Z is X.) A
172  /// negative value means not limited. Units: degrees.
173  ///
174  /// | ||
175  /// | -- | -- |
176  /// | Declaration | `float physics:coneAngle0Limit = -1` |
177  /// | C++ Type | float |
178  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
181 
182  /// See GetConeAngle0LimitAttr(), and also
183  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
184  /// If specified, author \p defaultValue as the attribute's default,
185  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
186  /// the default for \p writeSparsely is \c false.
188  UsdAttribute CreateConeAngle0LimitAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
189 
190 public:
191  // --------------------------------------------------------------------- //
192  // CONEANGLE1LIMIT
193  // --------------------------------------------------------------------- //
194  /// Cone limit from the primary joint axis in the local0 frame
195  /// toward the second to next axis. A negative value means not limited.
196  /// Units: degrees.
197  ///
198  /// | ||
199  /// | -- | -- |
200  /// | Declaration | `float physics:coneAngle1Limit = -1` |
201  /// | C++ Type | float |
202  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
205 
206  /// See GetConeAngle1LimitAttr(), and also
207  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
208  /// If specified, author \p defaultValue as the attribute's default,
209  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
210  /// the default for \p writeSparsely is \c false.
212  UsdAttribute CreateConeAngle1LimitAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
213 
214 public:
215  // ===================================================================== //
216  // Feel free to add custom code below this line, it will be preserved by
217  // the code generator.
218  //
219  // Just remember to:
220  // - Close the class declaration with };
221  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
222  // - Close the include guard with #endif
223  // ===================================================================== //
224  // --(BEGIN CUSTOM CODE)--
225 };
226 
228 
229 #endif
USDPHYSICS_API UsdAttribute GetConeAngle0LimitAttr() const
USDPHYSICS_API UsdAttribute GetConeAngle1LimitAttr() const
UsdPhysicsSphericalJoint(const UsdPrim &prim=UsdPrim())
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
USDPHYSICS_API UsdAttribute GetAxisAttr() const
static USDPHYSICS_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
USDPHYSICS_API UsdAttribute CreateConeAngle1LimitAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
static const UsdSchemaKind schemaKind
UsdPhysicsSphericalJoint(const UsdSchemaBase &schemaObj)
static USDPHYSICS_API UsdPhysicsSphericalJoint Get(const UsdStagePtr &stage, const SdfPath &path)
USDPHYSICS_API UsdAttribute CreateConeAngle0LimitAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
Represents a concrete typed schema.
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Definition: path.h:273
USDPHYSICS_API UsdAttribute CreateAxisAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
#define USDPHYSICS_API
Definition: api.h:23
UsdSchemaKind
Definition: common.h:112
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
static USDPHYSICS_API UsdPhysicsSphericalJoint Define(const UsdStagePtr &stage, const SdfPath &path)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: type.h:47
virtual USDPHYSICS_API ~UsdPhysicsSphericalJoint()
Destructor.
USDPHYSICS_API UsdSchemaKind _GetSchemaKind() const override
Definition: value.h:146