PxParticleBase.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA CORPORATION and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA CORPORATION is strictly prohibited.
9  */
10 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
11 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
12 
13 
14 #ifndef PX_PHYSICS_PX_PARTICLEBASE
15 #define PX_PHYSICS_PX_PARTICLEBASE
16 
20 #include "PxPhysXConfig.h"
21 #include "foundation/PxBounds3.h"
22 #include "PxFiltering.h"
24 #include "PxActor.h"
27 #include "PxForceMode.h"
28 
29 #ifndef PX_DOXYGEN
30 namespace physx
31 {
32 #endif
33 
47 class PxParticleBase : public PxActor
48 {
49 
50  public:
51 
52 /************************************************************************************************/
53 
57 
70  virtual PxParticleReadData* lockParticleReadData(PxDataAccessFlags flags) = 0;
71 
77  virtual PxParticleReadData* lockParticleReadData() = 0;
78 
92  virtual bool createParticles(const PxParticleCreationData& creationData) = 0;
93 
106  virtual void releaseParticles(PxU32 numParticles, const PxStrideIterator<const PxU32>& indexBuffer) = 0;
107 
113  virtual void releaseParticles() = 0;
114 
126  virtual void setPositions(PxU32 numParticles, const PxStrideIterator<const PxU32>& indexBuffer,
127  const PxStrideIterator<const PxVec3>& positionBuffer) = 0;
128 
140  virtual void setVelocities(PxU32 numParticles, const PxStrideIterator<const PxU32>& indexBuffer,
141  const PxStrideIterator<const PxVec3>& velocityBuffer) = 0;
142 
157  virtual void setRestOffsets(PxU32 numParticles, const PxStrideIterator<const PxU32>& indexBuffer,
158  const PxStrideIterator<const PxF32>& restOffsetBuffer) = 0;
159 
160 
171  virtual void addForces(PxU32 numParticles, const PxStrideIterator<const PxU32>& indexBuffer,
172  const PxStrideIterator<const PxVec3>& forceBuffer, PxForceMode::Enum forceMode) = 0;
173 
175 /************************************************************************************************/
176 
180 
186  virtual PxReal getDamping() const = 0;
187 
193  virtual void setDamping(PxReal damp) = 0;
194 
200  virtual PxVec3 getExternalAcceleration() const = 0;
201 
209  virtual void setExternalAcceleration(const PxVec3&acceleration) = 0;
210 
217  virtual void getProjectionPlane(PxVec3& normal, PxReal& distance) const = 0;
218 
229  virtual void setProjectionPlane(const PxVec3& normal, PxReal distance) = 0;
231 /************************************************************************************************/
232 
236 
242  virtual PxReal getParticleMass() const = 0;
243 
249  virtual void setParticleMass(PxReal mass) = 0;
250 
256  virtual PxReal getRestitution() const = 0;
257 
265  virtual void setRestitution(PxReal rest) = 0;
266 
272  virtual PxReal getDynamicFriction() const = 0;
273 
281  virtual void setDynamicFriction(PxReal friction) = 0;
282 
288  virtual PxReal getStaticFriction() const = 0;
289 
297  virtual void setStaticFriction(PxReal friction) = 0;
298 
300 /************************************************************************************************/
301 
305 
311  virtual void setSimulationFilterData(const PxFilterData& data) = 0;
312 
318  virtual PxFilterData getSimulationFilterData() const = 0;
319 
326  PX_DEPRECATED virtual void resetFiltering() = 0;
327 
329 /************************************************************************************************/
330 
337  virtual void setParticleBaseFlag(PxParticleBaseFlag::Enum flag, bool val) = 0;
338 
344  virtual PxParticleBaseFlags getParticleBaseFlags() const = 0;
345 
346 /************************************************************************************************/
347 
351 
357  virtual PxU32 getMaxParticles() const = 0;
358 
365  virtual PxReal getMaxMotionDistance() const = 0;
366 
373  virtual void setMaxMotionDistance(PxReal distance) = 0;
374 
380  virtual PxReal getRestOffset() const = 0;
381 
388  virtual void setRestOffset(PxReal restOffset) = 0;
389 
395  virtual PxReal getContactOffset() const = 0;
396 
403  virtual void setContactOffset(PxReal contactOffset) = 0;
404 
412  virtual PxReal getGridSize() const = 0;
413 
421  virtual void setGridSize(PxReal gridSize) = 0;
422 
428  virtual PxParticleReadDataFlags getParticleReadDataFlags() const = 0;
429 
436  virtual void setParticleReadDataFlag(PxParticleReadDataFlag::Enum flag, bool val)= 0;
437 
438 protected:
439  PX_INLINE PxParticleBase(PxType concreteType, PxBaseFlags baseFlags) : PxActor(concreteType, baseFlags) {}
440  PX_INLINE PxParticleBase(PxBaseFlags baseFlags) : PxActor(baseFlags) {}
441  virtual ~PxParticleBase() {}
442  virtual bool isKindOf(const char* name) const { return !strcmp("PxParticleBase", name) || PxActor::isKindOf(name); }
443 
445 /************************************************************************************************/
446 };
447 
449 PX_DEPRECATED PX_INLINE const PxParticleBase* PxActor::isParticleBase() const { return is<PxParticleBase>(); }
450 
451 
452 #ifndef PX_DOXYGEN
453 } // namespace physx
454 #endif
455 
457 #endif


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