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-2018 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 "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 PxArticulation;
00053 class PxArticulationLink;
00054 
00055 
00057 typedef PxU8 PxDominanceGroup;      // Must be < 32, PxU8.
00058 
00064 struct PxActorFlag
00065 {
00066     enum Enum
00067     {
00073         eVISUALIZATION                  = (1<<0),
00074 
00078         eDISABLE_GRAVITY                = (1<<1),
00079 
00085         eSEND_SLEEP_NOTIFIES            = (1<<2),
00086 
00103         eDISABLE_SIMULATION             = (1<<3)
00104     };
00105 };
00106 
00112 typedef PxFlags<PxActorFlag::Enum,PxU8> PxActorFlags;
00113 PX_FLAGS_OPERATORS(PxActorFlag::Enum,PxU8)
00114 
00115 
00119 struct PxActorType
00120 {
00121     enum Enum
00122     {
00127         eRIGID_STATIC,
00128 
00133         eRIGID_DYNAMIC,
00134         
00139         eARTICULATION_LINK,
00140 
00141         //brief internal use only!
00142         eACTOR_COUNT,
00143 
00144         eACTOR_FORCE_DWORD = 0x7fffffff
00145     };
00146 };
00147 
00154 class PxActor : public PxBase
00155 {
00156 public:
00166     virtual     void            release() = 0;
00167 
00175     virtual     PxActorType::Enum   getType()   const = 0;
00176 
00184     virtual     PxScene*        getScene()  const = 0;
00185 
00186     // Runtime modifications
00187 
00200     virtual     void            setName(const char* name)       = 0;
00201 
00209     virtual     const char*     getName()           const   = 0;
00210 
00220     virtual     PxBounds3       getWorldBounds(float inflation=1.01f) const = 0;
00221 
00236     virtual     void            setActorFlag(PxActorFlag::Enum flag, bool value) = 0;
00243     virtual     void            setActorFlags( PxActorFlags inFlags ) = 0;
00244 
00254     virtual     PxActorFlags    getActorFlags() const = 0;
00255 
00272     virtual     void            setDominanceGroup(PxDominanceGroup dominanceGroup)       = 0;
00273     
00281     virtual     PxDominanceGroup    getDominanceGroup() const = 0;
00282 
00283     
00293     virtual     void            setOwnerClient( PxClientID inClient ) = 0;
00294 
00302     virtual     PxClientID      getOwnerClient() const = 0;
00303 
00311     virtual     PxAggregate*    getAggregate()  const = 0;
00312 
00313     //public variables:
00314                 void*           userData;   
00315 
00316 protected:
00317     PX_INLINE                   PxActor(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags), userData(NULL) {}
00318     PX_INLINE                   PxActor(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
00319     virtual                     ~PxActor()  {}
00320     virtual     bool            isKindOf(const char* name)  const       {   return !::strcmp("PxActor", name) || PxBase::isKindOf(name); }
00321 
00322 
00323 };
00324 
00325 #if !PX_DOXYGEN
00326 } // namespace physx
00327 #endif
00328 
00330 #endif


Copyright © 2008-2018 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com