PxActor.h
Go to the documentation of this file.
1 //
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions
4 // are met:
5 // * Redistributions of source code must retain the above copyright
6 // notice, this list of conditions and the following disclaimer.
7 // * Redistributions in binary form must reproduce the above copyright
8 // notice, this list of conditions and the following disclaimer in the
9 // documentation and/or other materials provided with the distribution.
10 // * Neither the name of NVIDIA CORPORATION nor the names of its
11 // contributors may be used to endorse or promote products derived
12 // from this software without specific prior written permission.
13 //
14 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
15 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
18 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 //
26 // Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved.
27 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
28 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
29 
30 
31 #ifndef PX_PHYSICS_NX_ACTOR
32 #define PX_PHYSICS_NX_ACTOR
33 
38 #include "PxPhysXConfig.h"
39 #include "foundation/PxBounds3.h"
40 #include "PxClient.h"
41 #include "common/PxBase.h"
42 
43 #if !PX_DOXYGEN
44 namespace physx
45 {
46 #endif
47 
48 class PxRigidActor;
49 class PxRigidBody;
50 class PxRigidStatic;
51 class PxRigidDynamic;
52 class PxArticulation;
54 
55 
57 typedef PxU8 PxDominanceGroup; // Must be < 32, PxU8.
58 
65 {
66  enum Enum
67  {
73  eVISUALIZATION = (1<<0),
74 
78  eDISABLE_GRAVITY = (1<<1),
79 
85  eSEND_SLEEP_NOTIFIES = (1<<2),
86 
103  eDISABLE_SIMULATION = (1<<3)
104  };
105 };
106 
113 PX_FLAGS_OPERATORS(PxActorFlag::Enum,PxU8)
114 
115 
120 {
121  enum Enum
122  {
128 
134 
140 
141  //brief internal use only!
143 
144  eACTOR_FORCE_DWORD = 0x7fffffff
145  };
146 };
147 
154 class PxActor : public PxBase
155 {
156 public:
166  virtual void release() = 0;
167 
175  virtual PxActorType::Enum getType() const = 0;
176 
184  virtual PxScene* getScene() const = 0;
185 
186  // Runtime modifications
187 
200  virtual void setName(const char* name) = 0;
201 
209  virtual const char* getName() const = 0;
210 
220  virtual PxBounds3 getWorldBounds(float inflation=1.01f) const = 0;
221 
236  virtual void setActorFlag(PxActorFlag::Enum flag, bool value) = 0;
243  virtual void setActorFlags( PxActorFlags inFlags ) = 0;
244 
254  virtual PxActorFlags getActorFlags() const = 0;
255 
272  virtual void setDominanceGroup(PxDominanceGroup dominanceGroup) = 0;
273 
281  virtual PxDominanceGroup getDominanceGroup() const = 0;
282 
283 
293  virtual void setOwnerClient( PxClientID inClient ) = 0;
294 
302  virtual PxClientID getOwnerClient() const = 0;
303 
311  virtual PxAggregate* getAggregate() const = 0;
312 
313  //public variables:
314  void* userData;
315 
316 protected:
317  PX_INLINE PxActor(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags), userData(NULL) {}
318  PX_INLINE PxActor(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
319  virtual ~PxActor() {}
320  virtual bool isKindOf(const char* name) const { return !::strcmp("PxActor", name) || PxBase::isKindOf(name); }
321 
322 
323 };
324 
325 #if !PX_DOXYGEN
326 } // namespace physx
327 #endif
328 
330 #endif
Definition: GuContactBuffer.h:37
A scene is a collection of bodies and constraints which can interact.
Definition: PxScene.h:169
A dynamic rigid body.
Definition: PxActor.h:133
PxRigidDynamic represents a dynamic rigid simulation object in the physics SDK.
Definition: PxRigidDynamic.h:83
PxU8 PxDominanceGroup
Definition: PxActor.h:53
PX_INLINE PxActor(PxBaseFlags baseFlags)
Definition: PxActor.h:318
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition: PxActor.h:320
PxActor is the base class for the main simulation objects in the physics SDK.
Definition: PxActor.h:154
virtual bool isKindOf(const char *superClass) const
Returns whether a given type name matches with the type of this instance.
Definition: PxBase.h:178
Flags which control the behavior of an actor.
Definition: PxActor.h:64
void * userData
user can assign this to whatever, usually to create a 1:1 relationship with a user object...
Definition: PxActor.h:314
PxU16 PxType
Definition: PxBase.h:49
PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SD...
Definition: PxRigidActor.h:58
virtual ~PxActor()
Definition: PxActor.h:319
PX_FORCE_INLINE PxGeometryType::Enum getType() const
Definition: PxGeometryHelpers.h:88
A static rigid body.
Definition: PxActor.h:127
uint8_t PxU8
Definition: PxSimpleTypes.h:75
PX_INLINE PxActor(PxType concreteType, PxBaseFlags baseFlags)
Definition: PxActor.h:317
Identifies each type of actor.
Definition: PxActor.h:119
PxU8 PxClientID
An ID to identify different clients for multiclient support.
Definition: PxClient.h:46
Class representing 3D range or axis aligned bounding box.
Definition: PxBounds3.h:58
Definition: PxActor.h:142
Enum
Definition: PxActor.h:121
Enum
Definition: PxActor.h:66
PxFlags< PxActorFlag::Enum, PxU8 > PxActorFlags
collection of set bits defined in PxActorFlag.
Definition: PxActor.h:112
An articulation link.
Definition: PxActor.h:139
Container for bitfield flag variables associated with a specific enum type.
Definition: PxFlags.h:73
a tree structure of bodies connected by joints that is treated as a unit by the dynamics solver ...
Definition: PxArticulation.h:76
Class to aggregate actors into a single broad-phase entry.
Definition: PxAggregate.h:70
PxRigidBody is a base class shared between dynamic rigid body objects.
Definition: PxRigidBody.h:157
PxRigidStatic represents a static rigid body simulation object in the physics SDK.
Definition: PxRigidStatic.h:59
Base class for objects that can be members of a PxCollection.
Definition: PxBase.h:73
#define PX_INLINE
Definition: PxPreprocessor.h:349