PhysX SDK 3.2 API Reference: PxParticleBase.h Source File

PhysX SDK 3.2 API

PxParticleBase.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_PX_PARTICLEBASE
00032 #define PX_PHYSICS_PX_PARTICLEBASE
00033 
00037 #include "PxPhysX.h"
00038 #include "foundation/PxBounds3.h"
00039 #include "PxFiltering.h"
00040 #include "particles/PxParticleBaseFlag.h"
00041 #include "PxActor.h"
00042 #include "PxPhysics.h"
00043 #include "particles/PxParticleCreationData.h"
00044 #include "particles/PxParticleReadData.h"
00045 #include "PxForceMode.h"
00046 
00047 #ifndef PX_DOXYGEN
00048 namespace physx
00049 {
00050 #endif
00051 
00065 class PxParticleBase : public PxActor
00066 {
00067 
00068     public:
00069 
00070 /************************************************************************************************/
00071 
00075 
00084     virtual     PxParticleReadData*         lockParticleReadData() = 0;
00085 
00099     virtual     bool                        createParticles(const PxParticleCreationData& creationData)                                     = 0;
00100 
00113     virtual     void                        releaseParticles(PxU32 numParticles, const PxStrideIterator<const PxU32>& indexBuffer)                  = 0;
00114 
00120     virtual     void                        releaseParticles()                                                                                      = 0;
00121 
00133     virtual     void                        setPositions(PxU32 numParticles, const PxStrideIterator<const PxU32>& indexBuffer,
00134                                                          const PxStrideIterator<const PxVec3>& positionBuffer)                                      = 0;
00135 
00147     virtual     void                        setVelocities(PxU32 numParticles, const PxStrideIterator<const PxU32>& indexBuffer,
00148                                                           const PxStrideIterator<const PxVec3>& velocityBuffer)                                     = 0;
00149 
00164     virtual     void                        setRestOffsets(PxU32 numParticles, const PxStrideIterator<const PxU32>& indexBuffer,
00165                                                            const PxStrideIterator<const PxF32>& restOffsetBuffer)                                   = 0;
00166 
00167 
00178     virtual     void                        addForces(PxU32 numParticles, const PxStrideIterator<const PxU32>& indexBuffer,
00179                                                       const PxStrideIterator<const PxVec3>& forceBuffer, PxForceMode::Enum forceMode)               = 0;
00180 
00182 /************************************************************************************************/
00183 
00187 
00193     virtual     PxReal                      getDamping()                                                const   = 0;
00194 
00200     virtual     void                        setDamping(PxReal damp)                                             = 0;
00201 
00207     virtual     PxVec3                      getExternalAcceleration()                                   const   = 0;
00208 
00216     virtual     void                        setExternalAcceleration(const PxVec3&acceleration)                  = 0;
00217 
00224     virtual     void                        getProjectionPlane(PxVec3& normal, PxReal& distance)        const   = 0;
00225 
00236     virtual     void                        setProjectionPlane(const PxVec3& normal, PxReal distance)           = 0;
00238 /************************************************************************************************/
00239 
00243 
00249     virtual     PxReal                      getParticleMass()                                           const   = 0;
00250 
00256     virtual     void                        setParticleMass(PxReal mass)                                        = 0;
00257 
00263     virtual     PxReal                      getRestitution()                                            const   = 0;
00264 
00272     virtual     void                        setRestitution(PxReal rest)                                         = 0;
00273 
00279     virtual     PxReal                      getDynamicFriction()                                        const   = 0;
00280 
00288     virtual     void                        setDynamicFriction(PxReal friction)                                 = 0;
00289 
00295     virtual     PxReal                      getStaticFriction()                                         const   = 0;
00296 
00304     virtual     void                        setStaticFriction(PxReal friction)                                  = 0;
00305 
00307 /************************************************************************************************/
00308 
00312 
00318     virtual     void                        setSimulationFilterData(const PxFilterData& data)                   = 0;
00319 
00325     virtual     PxFilterData                getSimulationFilterData()                                   const   = 0;
00326 
00334     virtual     void                        resetFiltering()                                                    = 0;
00335 
00337 /************************************************************************************************/
00338 
00345     virtual     void                        setParticleBaseFlag(PxParticleBaseFlag::Enum flag, bool val)    = 0;
00346 
00352     virtual     PxParticleBaseFlags         getParticleBaseFlags()                                  const   = 0;
00353 
00354 /************************************************************************************************/
00355 
00359 
00365     virtual     PxU32                       getMaxParticles()                                       const   = 0;
00366 
00373     virtual     PxReal                      getMaxMotionDistance()                                  const   = 0;
00374 
00381     virtual     void                        setMaxMotionDistance(PxReal distance)                           = 0;
00382 
00388     virtual     PxReal                      getRestOffset()                                         const   = 0;
00389 
00396     virtual     void                        setRestOffset(PxReal restOffset)                                = 0;
00397 
00403     virtual     PxReal                      getContactOffset()                                      const   = 0;
00404 
00411     virtual     void                        setContactOffset(PxReal contactOffset)                          = 0;
00412 
00420     virtual     PxReal                      getGridSize()                                           const   = 0;
00421 
00429     virtual     void                        setGridSize(PxReal gridSize)                                    = 0;
00430 
00436     virtual     PxParticleReadDataFlags     getParticleReadDataFlags()                              const   = 0;
00437 
00444     virtual     void                        setParticleReadDataFlag(PxParticleReadDataFlag::Enum flag, bool val)= 0;
00445 
00446 protected:
00447                                             PxParticleBase(PxRefResolver& v) : PxActor(v)       {}
00448     PX_INLINE                               PxParticleBase() : PxActor() {}
00449     virtual                                 ~PxParticleBase() {}
00450     virtual     bool                        isKindOf(const char* name)  const       {   return !strcmp("PxParticleBase", name) || PxActor::isKindOf(name);  }
00451 
00453 /************************************************************************************************/
00454 };
00455 
00456 PX_INLINE PxParticleBase*       PxActor::isParticleBase()           { return is<PxParticleBase>();          }
00457 PX_INLINE const PxParticleBase* PxActor::isParticleBase()   const   { return is<PxParticleBase>();          }
00458 
00459 
00460 #ifndef PX_DOXYGEN
00461 } // namespace physx
00462 #endif
00463 
00465 #endif


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