HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
distanceJoint.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_DISTANCEJOINT_H
8 #define USDPHYSICS_GENERATED_DISTANCEJOINT_H
9 
10 /// \file usdPhysics/distanceJoint.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 // PHYSICSDISTANCEJOINT //
34 // -------------------------------------------------------------------------- //
35 
36 /// \class UsdPhysicsDistanceJoint
37 ///
38 /// Predefined distance joint type (Distance between rigid bodies
39 /// may be limited to given minimum or maximum distance.)
40 ///
42 {
43 public:
44  /// Compile time constant representing what kind of schema this class is.
45  ///
46  /// \sa UsdSchemaKind
48 
49  /// Construct a UsdPhysicsDistanceJoint on UsdPrim \p prim .
50  /// Equivalent to UsdPhysicsDistanceJoint::Get(prim.GetStage(), prim.GetPath())
51  /// for a \em valid \p prim, but will not immediately throw an error for
52  /// an invalid \p prim
53  explicit UsdPhysicsDistanceJoint(const UsdPrim& prim=UsdPrim())
54  : UsdPhysicsJoint(prim)
55  {
56  }
57 
58  /// Construct a UsdPhysicsDistanceJoint on the prim held by \p schemaObj .
59  /// Should be preferred over UsdPhysicsDistanceJoint(schemaObj.GetPrim()),
60  /// as it preserves SchemaBase state.
61  explicit UsdPhysicsDistanceJoint(const UsdSchemaBase& schemaObj)
62  : UsdPhysicsJoint(schemaObj)
63  {
64  }
65 
66  /// Destructor.
68  virtual ~UsdPhysicsDistanceJoint();
69 
70  /// Return a vector of names of all pre-declared attributes for this schema
71  /// class and all its ancestor classes. Does not include attributes that
72  /// may be authored by custom/extended methods of the schemas involved.
74  static const TfTokenVector &
75  GetSchemaAttributeNames(bool includeInherited=true);
76 
77  /// Return a UsdPhysicsDistanceJoint holding the prim adhering to this
78  /// schema at \p path on \p stage. If no prim exists at \p path on
79  /// \p stage, or if the prim at that path does not adhere to this schema,
80  /// return an invalid schema object. This is shorthand for the following:
81  ///
82  /// \code
83  /// UsdPhysicsDistanceJoint(stage->GetPrimAtPath(path));
84  /// \endcode
85  ///
88  Get(const UsdStagePtr &stage, const SdfPath &path);
89 
90  /// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
91  /// is defined (according to UsdPrim::IsDefined()) on this stage.
92  ///
93  /// If a prim adhering to this schema at \p path is already defined on this
94  /// stage, return that prim. Otherwise author an \a SdfPrimSpec with
95  /// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
96  /// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
97  /// with \p specifier == \a SdfSpecifierDef and empty typeName at the
98  /// current EditTarget for any nonexistent, or existing but not \a Defined
99  /// ancestors.
100  ///
101  /// The given \a path must be an absolute prim path that does not contain
102  /// any variant selections.
103  ///
104  /// If it is impossible to author any of the necessary PrimSpecs, (for
105  /// example, in case \a path cannot map to the current UsdEditTarget's
106  /// namespace) issue an error and return an invalid \a UsdPrim.
107  ///
108  /// Note that this method may return a defined prim whose typeName does not
109  /// specify this schema class, in case a stronger typeName opinion overrides
110  /// the opinion at the current EditTarget.
111  ///
114  Define(const UsdStagePtr &stage, const SdfPath &path);
115 
116 protected:
117  /// Returns the kind of schema this class belongs to.
118  ///
119  /// \sa UsdSchemaKind
121  UsdSchemaKind _GetSchemaKind() const override;
122 
123 private:
124  // needs to invoke _GetStaticTfType.
125  friend class UsdSchemaRegistry;
127  static const TfType &_GetStaticTfType();
128 
129  static bool _IsTypedSchema();
130 
131  // override SchemaBase virtuals.
133  const TfType &_GetTfType() const override;
134 
135 public:
136  // --------------------------------------------------------------------- //
137  // MINDISTANCE
138  // --------------------------------------------------------------------- //
139  /// Minimum distance. If attribute is negative, the joint is not
140  /// limited. Units: distance.
141  ///
142  /// | ||
143  /// | -- | -- |
144  /// | Declaration | `float physics:minDistance = -1` |
145  /// | C++ Type | float |
146  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
149 
150  /// See GetMinDistanceAttr(), and also
151  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
152  /// If specified, author \p defaultValue as the attribute's default,
153  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
154  /// the default for \p writeSparsely is \c false.
156  UsdAttribute CreateMinDistanceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
157 
158 public:
159  // --------------------------------------------------------------------- //
160  // MAXDISTANCE
161  // --------------------------------------------------------------------- //
162  /// Maximum distance. If attribute is negative, the joint is not
163  /// limited. Units: distance.
164  ///
165  /// | ||
166  /// | -- | -- |
167  /// | Declaration | `float physics:maxDistance = -1` |
168  /// | C++ Type | float |
169  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
172 
173  /// See GetMaxDistanceAttr(), and also
174  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
175  /// If specified, author \p defaultValue as the attribute's default,
176  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
177  /// the default for \p writeSparsely is \c false.
179  UsdAttribute CreateMaxDistanceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
180 
181 public:
182  // ===================================================================== //
183  // Feel free to add custom code below this line, it will be preserved by
184  // the code generator.
185  //
186  // Just remember to:
187  // - Close the class declaration with };
188  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
189  // - Close the include guard with #endif
190  // ===================================================================== //
191  // --(BEGIN CUSTOM CODE)--
192 };
193 
195 
196 #endif
static USDPHYSICS_API UsdPhysicsDistanceJoint Get(const UsdStagePtr &stage, const SdfPath &path)
UsdPhysicsDistanceJoint(const UsdPrim &prim=UsdPrim())
Definition: distanceJoint.h:53
USDPHYSICS_API UsdAttribute GetMaxDistanceAttr() const
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
static USDPHYSICS_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
USDPHYSICS_API UsdSchemaKind _GetSchemaKind() const override
static USDPHYSICS_API UsdPhysicsDistanceJoint Define(const UsdStagePtr &stage, const SdfPath &path)
USDPHYSICS_API UsdAttribute CreateMaxDistanceAttr(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
#define USDPHYSICS_API
Definition: api.h:23
UsdSchemaKind
Definition: common.h:112
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: type.h:47
USDPHYSICS_API UsdAttribute CreateMinDistanceAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
virtual USDPHYSICS_API ~UsdPhysicsDistanceJoint()
Destructor.
USDPHYSICS_API UsdAttribute GetMinDistanceAttr() const
static const UsdSchemaKind schemaKind
Definition: distanceJoint.h:47
UsdPhysicsDistanceJoint(const UsdSchemaBase &schemaObj)
Definition: distanceJoint.h:61
Definition: value.h:146