All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
collisionGroup.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_COLLISIONGROUP_H
8#define USDPHYSICS_GENERATED_COLLISIONGROUP_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdPhysics/api.h"
14#include "pxr/usd/usd/typed.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
18
20
21#include "pxr/base/vt/value.h"
22
23#include "pxr/base/gf/vec3d.h"
24#include "pxr/base/gf/vec3f.h"
26
27#include "pxr/base/tf/token.h"
28#include "pxr/base/tf/type.h"
29
30PXR_NAMESPACE_OPEN_SCOPE
31
32class SdfAssetPath;
33
34// -------------------------------------------------------------------------- //
35// PHYSICSCOLLISIONGROUP //
36// -------------------------------------------------------------------------- //
37
50{
51public:
55 static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
56
62 : UsdTyped(prim)
63 {
64 }
65
69 explicit UsdPhysicsCollisionGroup(const UsdSchemaBase& schemaObj)
70 : UsdTyped(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
120 USDPHYSICS_API
122 Define(const UsdStagePtr &stage, const SdfPath &path);
123
124protected:
128 USDPHYSICS_API
130
131private:
132 // needs to invoke _GetStaticTfType.
133 friend class UsdSchemaRegistry;
134 USDPHYSICS_API
135 static const TfType &_GetStaticTfType();
136
137 static bool _IsTypedSchema();
138
139 // override SchemaBase virtuals.
140 USDPHYSICS_API
141 const TfType &_GetTfType() const override;
142
143public:
144 // --------------------------------------------------------------------- //
145 // MERGEGROUPNAME
146 // --------------------------------------------------------------------- //
157 USDPHYSICS_API
159
165 USDPHYSICS_API
166 UsdAttribute CreateMergeGroupNameAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
167
168public:
169 // --------------------------------------------------------------------- //
170 // INVERTFILTEREDGROUPS
171 // --------------------------------------------------------------------- //
182 USDPHYSICS_API
184
190 USDPHYSICS_API
191 UsdAttribute CreateInvertFilteredGroupsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
192
193public:
194 // --------------------------------------------------------------------- //
195 // FILTEREDGROUPS
196 // --------------------------------------------------------------------- //
200 USDPHYSICS_API
202
205 USDPHYSICS_API
207
208public:
209 // ===================================================================== //
210 // Feel free to add custom code below this line, it will be preserved by
211 // the code generator.
212 //
213 // Just remember to:
214 // - Close the class declaration with };
215 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
216 // - Close the include guard with #endif
217 // ===================================================================== //
218 // --(BEGIN CUSTOM CODE)--
219
222 USDPHYSICS_API
224
229 {
232 USDPHYSICS_API
233 const SdfPathVector& GetCollisionGroups() const;
234
236 USDPHYSICS_API
237 bool IsCollisionEnabled(const unsigned int idxA,
238 const unsigned int idxB) const;
239
241 USDPHYSICS_API
242 bool IsCollisionEnabled(const SdfPath& primA,
243 const SdfPath& primB) const;
244
245 protected:
246 friend class UsdPhysicsCollisionGroup;
247 // < All collision groups known to this table
248 SdfPathVector _groups;
249 // < 2D table, with one element per collision-group-pair. Entry is false
250 // if collision is disabled by a filtering rule.
251 std::vector<bool> _enabled;
252 };
253
258 static USDPHYSICS_API
260};
261
262PXR_NAMESPACE_CLOSE_SCOPE
263
264#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
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:160
A general purpose API schema used to describe a collection of prims and properties within a scene.
Defines a collision group for coarse filtering.
USDPHYSICS_API UsdAttribute CreateInvertFilteredGroupsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetInvertFilteredGroupsAttr(), and also Create vs Get Property Methods for when to use Get vs Cre...
USDPHYSICS_API UsdRelationship CreateFilteredGroupsRel() const
See GetFilteredGroupsRel(), and also Create vs Get Property Methods for when to use Get vs Create.
USDPHYSICS_API UsdAttribute GetMergeGroupNameAttr() const
If non-empty, any collision groups in a stage with a matching mergeGroup should be considered to refe...
USDPHYSICS_API UsdAttribute CreateMergeGroupNameAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetMergeGroupNameAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
USDPHYSICS_API UsdCollectionAPI GetCollidersCollectionAPI() const
Return the UsdCollectionAPI interface used for defining what colliders belong to the CollisionGroup.
static USDPHYSICS_API UsdPhysicsCollisionGroup Define(const UsdStagePtr &stage, const SdfPath &path)
Attempt to ensure a UsdPrim adhering to this schema at path is defined (according to UsdPrim::IsDefin...
virtual USDPHYSICS_API ~UsdPhysicsCollisionGroup()
Destructor.
UsdPhysicsCollisionGroup(const UsdPrim &prim=UsdPrim())
Construct a UsdPhysicsCollisionGroup on UsdPrim prim .
static USDPHYSICS_API CollisionGroupTable ComputeCollisionGroupTable(const UsdStage &stage)
Compute a table encoding all the collision groups filter rules for a stage.
UsdPhysicsCollisionGroup(const UsdSchemaBase &schemaObj)
Construct a UsdPhysicsCollisionGroup on the prim held by schemaObj .
static USDPHYSICS_API UsdPhysicsCollisionGroup Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdPhysicsCollisionGroup holding the prim adhering to this schema at path on stage.
USDPHYSICS_API UsdAttribute GetInvertFilteredGroupsAttr() const
Normally, the filter will disable collisions against the selected filter groups.
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 UsdRelationship GetFilteredGroupsRel() const
References a list of PhysicsCollisionGroups with which collisions should be ignored.
USDPHYSICS_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:111
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...
The outermost container for scene description, which owns and presents composed prims as a scenegraph...
Definition: stage.h:136
The base class for all typed schemas (those that can impart a typeName to a UsdPrim),...
Definition: typed.h:45
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
Utility structure generated by ComputeCollisionGroupTable(); contains a table describing which pairs ...
USDPHYSICS_API bool IsCollisionEnabled(const SdfPath &primA, const SdfPath &primB) const
Return true if the groups primA and primB collide.
USDPHYSICS_API const SdfPathVector & GetCollisionGroups() const
Return the set of all UsdPhysicsCollisionGroup which this table contains.
USDPHYSICS_API bool IsCollisionEnabled(const unsigned int idxA, const unsigned int idxB) const
Return true if the groups at indices idxA and idxB collide.
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