00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef PX_PHYSICS_NX_ACTOR
00032 #define PX_PHYSICS_NX_ACTOR
00033
00038 #include "PxPhysXConfig.h"
00039 #include "foundation/PxBounds3.h"
00040 #include "PxClient.h"
00041 #include "common/PxBase.h"
00042
00043 #if !PX_DOXYGEN
00044 namespace physx
00045 {
00046 #endif
00047
00048 class PxRigidActor;
00049 class PxRigidBody;
00050 class PxRigidStatic;
00051 class PxRigidDynamic;
00052 class PxParticleBase;
00053 class PxParticleSystem;
00054 class PxParticleFluid;
00055 class PxArticulation;
00056 class PxArticulationLink;
00057
00058
00060 typedef PxU8 PxDominanceGroup;
00061
00067 struct PxActorFlag
00068 {
00069 enum Enum
00070 {
00076 eVISUALIZATION = (1<<0),
00077
00081 eDISABLE_GRAVITY = (1<<1),
00082
00088 eSEND_SLEEP_NOTIFIES = (1<<2),
00089
00106 eDISABLE_SIMULATION = (1<<3)
00107 };
00108 };
00109
00115 typedef PxFlags<PxActorFlag::Enum,PxU8> PxActorFlags;
00116 PX_FLAGS_OPERATORS(PxActorFlag::Enum,PxU8)
00117
00118
00122 struct PxActorType
00123 {
00124 enum Enum
00125 {
00130 eRIGID_STATIC,
00131
00136 eRIGID_DYNAMIC,
00137
00138 #if PX_USE_PARTICLE_SYSTEM_API
00139
00144 ePARTICLE_SYSTEM PX_DEPRECATED,
00145
00151 ePARTICLE_FLUID PX_DEPRECATED,
00152 #endif
00153
00158 eARTICULATION_LINK,
00159
00160 #if PX_USE_CLOTH_API
00161
00165 eCLOTH,
00166 #endif
00167
00168
00169 eACTOR_COUNT,
00170
00171 eACTOR_FORCE_DWORD = 0x7fffffff
00172 };
00173 };
00174
00181 class PxActor : public PxBase
00182 {
00183 public:
00193 virtual void release() = 0;
00194
00202 virtual PxActorType::Enum getType() const = 0;
00203
00211 virtual PxScene* getScene() const = 0;
00212
00213
00214
00227 virtual void setName(const char* name) = 0;
00228
00236 virtual const char* getName() const = 0;
00237
00247 virtual PxBounds3 getWorldBounds(float inflation=1.01f) const = 0;
00248
00263 virtual void setActorFlag(PxActorFlag::Enum flag, bool value) = 0;
00270 virtual void setActorFlags( PxActorFlags inFlags ) = 0;
00271
00281 virtual PxActorFlags getActorFlags() const = 0;
00282
00299 virtual void setDominanceGroup(PxDominanceGroup dominanceGroup) = 0;
00300
00308 virtual PxDominanceGroup getDominanceGroup() const = 0;
00309
00310
00320 virtual void setOwnerClient( PxClientID inClient ) = 0;
00321
00329 virtual PxClientID getOwnerClient() const = 0;
00330
00346 PX_DEPRECATED virtual void setClientBehaviorFlags(PxActorClientBehaviorFlags) = 0;
00347
00357 PX_DEPRECATED virtual PxActorClientBehaviorFlags getClientBehaviorFlags() const = 0;
00358
00366 virtual PxAggregate* getAggregate() const = 0;
00367
00368
00369 void* userData;
00370
00371
00372 protected:
00373 PX_INLINE PxActor(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags), userData(NULL) {}
00374 PX_INLINE PxActor(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
00375 virtual ~PxActor() {}
00376 virtual bool isKindOf(const char* name) const { return !::strcmp("PxActor", name) || PxBase::isKindOf(name); }
00377
00378
00379 };
00380
00381 #if !PX_DOXYGEN
00382 }
00383 #endif
00384
00386 #endif