PxActor.h
Go to the documentation of this file.00001 // This code contains NVIDIA Confidential Information and is disclosed to you 00002 // under a form of NVIDIA software license agreement provided separately to you. 00003 // 00004 // Notice 00005 // NVIDIA Corporation and its licensors retain all intellectual property and 00006 // proprietary rights in and to this software and related documentation and 00007 // any modifications thereto. Any use, reproduction, disclosure, or 00008 // distribution of this software and related documentation without an express 00009 // license agreement from NVIDIA Corporation is strictly prohibited. 00010 // 00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES 00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO 00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, 00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. 00015 // 00016 // Information and code furnished is believed to be accurate and reliable. 00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such 00018 // information or for any infringement of patents or other rights of third parties that may 00019 // result from its use. No license is granted by implication or otherwise under any patent 00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice. 00021 // This code supersedes and replaces all information previously supplied. 00022 // NVIDIA Corporation products are not authorized for use as critical 00023 // components in life support devices or systems without express written approval of 00024 // NVIDIA Corporation. 00025 // 00026 // Copyright (c) 2008-2012 NVIDIA Corporation. All rights reserved. 00027 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. 00028 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. 00029 00030 00031 #ifndef PX_PHYSICS_NX_ACTOR 00032 #define PX_PHYSICS_NX_ACTOR 00033 00038 #include "PxPhysX.h" 00039 #include "foundation/PxBounds3.h" 00040 #include "PxPhysics.h" 00041 #include "PxObserver.h" 00042 #include "PxClient.h" 00043 #include "common/PxSerialFramework.h" 00044 00045 #ifndef PX_DOXYGEN 00046 namespace physx 00047 { 00048 #endif 00049 00050 class PxRigidActor; 00051 class PxRigidBody; 00052 class PxRigidStatic; 00053 class PxRigidDynamic; 00054 class PxParticleBase; 00055 class PxParticleSystem; 00056 class PxParticleFluid; 00057 class PxArticulation; 00058 class PxArticulationLink; 00059 00060 00062 typedef PxU8 PxDominanceGroup; // Must be < 32, PxU8. 00063 00069 struct PxActorFlag 00070 { 00071 enum Enum 00072 { 00078 eVISUALIZATION = (1<<0), 00079 00083 eDISABLE_GRAVITY = (1<<1), 00084 00090 eSEND_SLEEP_NOTIFIES = (1<<2) 00091 00092 }; 00093 }; 00094 00100 typedef PxFlags<PxActorFlag::Enum,PxU16> PxActorFlags; 00101 PX_FLAGS_OPERATORS(PxActorFlag::Enum,PxU16); 00102 00107 struct PxActorType 00108 { 00109 enum Enum 00110 { 00115 eRIGID_STATIC, 00116 00121 eRIGID_DYNAMIC, 00122 00123 #if PX_USE_PARTICLE_SYSTEM_API 00124 00128 ePARTICLE_SYSTEM, 00129 00134 ePARTICLE_FLUID, 00135 #endif 00136 00141 eARTICULATION_LINK, 00142 00143 #if PX_USE_CLOTH_API 00144 00148 eCLOTH, 00149 #endif 00150 00151 //brief internal use only! 00152 eACTOR_COUNT, 00153 00154 eACTOR_FORCE_DWORD = 0x7fffffff 00155 }; 00156 }; 00157 00165 class PxActor : public PxSerializable, public PxObservable 00166 { 00167 public: 00180 virtual void release() = 0; 00181 00189 virtual PxActorType::Enum getType() const = 0; 00190 00191 00202 PX_DEPRECATED PX_INLINE PxRigidStatic* isRigidStatic(); 00203 PX_DEPRECATED PX_INLINE const PxRigidStatic* isRigidStatic() const; 00204 PX_DEPRECATED PX_INLINE PxRigidDynamic* isRigidDynamic(); 00205 PX_DEPRECATED PX_INLINE const PxRigidDynamic* isRigidDynamic() const; 00206 PX_DEPRECATED PX_INLINE PxParticleSystem* isParticleSystem(); 00207 PX_DEPRECATED PX_INLINE const PxParticleSystem* isParticleSystem() const; 00208 PX_DEPRECATED PX_INLINE PxParticleFluid* isParticleFluid(); 00209 PX_DEPRECATED PX_INLINE const PxParticleFluid* isParticleFluid() const; 00210 PX_DEPRECATED PX_INLINE PxArticulationLink* isArticulationLink(); 00211 PX_DEPRECATED PX_INLINE const PxArticulationLink* isArticulationLink() const; 00212 PX_DEPRECATED PX_INLINE PxCloth* isCloth(); 00213 PX_DEPRECATED PX_INLINE const PxCloth* isCloth() const; 00214 00215 PX_DEPRECATED PX_INLINE PxRigidActor* isRigidActor(); 00216 PX_DEPRECATED PX_INLINE const PxRigidActor* isRigidActor() const; 00217 PX_DEPRECATED PX_INLINE PxRigidBody* isRigidBody(); 00218 PX_DEPRECATED PX_INLINE const PxRigidBody* isRigidBody() const; 00219 PX_DEPRECATED PX_INLINE PxParticleBase* isParticleBase(); 00220 PX_DEPRECATED PX_INLINE const PxParticleBase* isParticleBase() const; 00221 00229 virtual PxScene* getScene() const = 0; 00230 00231 // Runtime modifications 00232 00245 virtual void setName(const char* name) = 0; 00246 00254 virtual const char* getName() const = 0; 00255 00263 virtual PxBounds3 getWorldBounds() const = 0; 00264 00279 virtual void setActorFlag(PxActorFlag::Enum flag, bool value) = 0; 00286 virtual void setActorFlags( PxActorFlags inFlags ) = 0; 00287 00297 virtual PxActorFlags getActorFlags() const = 0; 00298 00315 virtual void setDominanceGroup(PxDominanceGroup dominanceGroup) = 0; 00316 00324 virtual PxDominanceGroup getDominanceGroup() const = 0; 00325 00326 00336 virtual void setOwnerClient( PxClientID inClient ) = 0; 00337 00345 virtual PxClientID getOwnerClient() const = 0; 00346 00360 virtual void setClientBehaviorBits(PxU32) = 0; 00361 00369 virtual PxU32 getClientBehaviorBits() const = 0; 00370 00378 virtual PxAggregate* getAggregate() const = 0; 00379 00380 //public variables: 00381 void* userData; 00382 00383 00384 protected: 00385 PxActor(PxRefResolver& v) : PxSerializable(v) {} 00386 PX_INLINE PxActor() : userData(NULL) {} 00387 virtual ~PxActor() {} 00388 virtual bool isKindOf(const char* name) const { return !strcmp("PxActor", name) || PxSerializable::isKindOf(name); } 00389 00390 00391 }; 00392 00393 #ifndef PX_DOXYGEN 00394 } // namespace physx 00395 #endif 00396 00398 #endif
Copyright © 2008-2012 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com