PxActor.h

Go to the documentation of this file.
00001 //
00002 // Redistribution and use in source and binary forms, with or without
00003 // modification, are permitted provided that the following conditions
00004 // are met:
00005 //  * Redistributions of source code must retain the above copyright
00006 //    notice, this list of conditions and the following disclaimer.
00007 //  * Redistributions in binary form must reproduce the above copyright
00008 //    notice, this list of conditions and the following disclaimer in the
00009 //    documentation and/or other materials provided with the distribution.
00010 //  * Neither the name of NVIDIA CORPORATION nor the names of its
00011 //    contributors may be used to endorse or promote products derived
00012 //    from this software without specific prior written permission.
00013 //
00014 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
00015 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00017 // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00018 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00019 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00020 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00021 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00022 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00023 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00024 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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 PxParticleBase;
00053 class PxParticleSystem;
00054 class PxParticleFluid;
00055 class PxArticulation;
00056 class PxArticulationLink;
00057 
00058 
00060 typedef PxU8 PxDominanceGroup;      // Must be < 32, PxU8.
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 
00166         eCLOTH PX_DEPRECATED,
00167 #endif
00168 
00169         //brief internal use only!
00170         eACTOR_COUNT,
00171 
00172         eACTOR_FORCE_DWORD = 0x7fffffff
00173     };
00174 };
00175 
00182 class PxActor : public PxBase
00183 {
00184 public:
00194     virtual     void            release() = 0;
00195 
00203     virtual     PxActorType::Enum   getType()   const = 0;
00204 
00212     virtual     PxScene*        getScene()  const = 0;
00213 
00214     // Runtime modifications
00215 
00228     virtual     void            setName(const char* name)       = 0;
00229 
00237     virtual     const char*     getName()           const   = 0;
00238 
00248     virtual     PxBounds3       getWorldBounds(float inflation=1.01f) const = 0;
00249 
00264     virtual     void            setActorFlag(PxActorFlag::Enum flag, bool value) = 0;
00271     virtual     void            setActorFlags( PxActorFlags inFlags ) = 0;
00272 
00282     virtual     PxActorFlags    getActorFlags() const = 0;
00283 
00300     virtual     void            setDominanceGroup(PxDominanceGroup dominanceGroup)       = 0;
00301     
00309     virtual     PxDominanceGroup    getDominanceGroup() const = 0;
00310 
00311     
00321     virtual     void            setOwnerClient( PxClientID inClient ) = 0;
00322 
00330     virtual     PxClientID      getOwnerClient() const = 0;
00331 
00347     PX_DEPRECATED virtual       void            setClientBehaviorFlags(PxActorClientBehaviorFlags) = 0;
00348 
00358     PX_DEPRECATED virtual       PxActorClientBehaviorFlags  getClientBehaviorFlags()    const = 0;
00359 
00367     virtual     PxAggregate*    getAggregate()  const = 0;
00368 
00369     //public variables:
00370                 void*           userData;   
00371 
00372 
00373 protected:
00374     PX_INLINE                   PxActor(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags), userData(NULL) {}
00375     PX_INLINE                   PxActor(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
00376     virtual                     ~PxActor()  {}
00377     virtual     bool            isKindOf(const char* name)  const       {   return !::strcmp("PxActor", name) || PxBase::isKindOf(name); }
00378 
00379 
00380 };
00381 
00382 #if !PX_DOXYGEN
00383 } // namespace physx
00384 #endif
00385 
00387 #endif


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