Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef EMITTER_GEOMS_H
00031 #define EMITTER_GEOMS_H
00032
00033 #include "Apex.h"
00034
00035 namespace nvidia
00036 {
00037 namespace apex
00038 {
00039
00040 PX_PUSH_PACK_DEFAULT
00041
00043 struct EmitterType
00044 {
00046 enum Enum
00047 {
00048 ET_RATE = 0,
00049 ET_DENSITY_ONCE,
00050 ET_DENSITY_BRUSH,
00051 ET_FILL,
00052 ET_UNDEFINED,
00053 };
00054 };
00055
00056 class EmitterGeomBox;
00057 class EmitterGeomSphere;
00058 class EmitterGeomSphereShell;
00059 class EmitterGeomCylinder;
00060 class EmitterGeomExplicit;
00061
00063 class EmitterGeom
00064 {
00065 public:
00067 virtual void setEmitterType(EmitterType::Enum) = 0;
00068
00070 virtual EmitterType::Enum getEmitterType() const = 0;
00071
00073 virtual const EmitterGeomBox* isBoxGeom() const
00074 {
00075 return NULL;
00076 }
00077
00079 virtual const EmitterGeomSphere* isSphereGeom() const
00080 {
00081 return NULL;
00082 }
00083
00085 virtual const EmitterGeomSphereShell* isSphereShellGeom() const
00086 {
00087 return NULL;
00088 }
00089
00091 virtual const EmitterGeomCylinder* isCylinderGeom() const
00092 {
00093 return NULL;
00094 }
00095
00097 virtual const EmitterGeomExplicit* isExplicitGeom() const
00098 {
00099 return NULL;
00100 }
00101 };
00102
00104 class EmitterGeomSphereShell : public EmitterGeom
00105 {
00106 public:
00107
00109 virtual void setRadius(float radius) = 0;
00110
00112 virtual float getRadius() const = 0;
00113
00115 virtual void setShellThickness(float thickness) = 0;
00116
00118 virtual float getShellThickness() const = 0;
00119 };
00120
00122 class EmitterGeomSphere : public EmitterGeom
00123 {
00124 public:
00125
00127 virtual void setRadius(float radius) = 0;
00128
00130 virtual float getRadius() const = 0;
00131 };
00132
00134 class EmitterGeomCylinder : public EmitterGeom
00135 {
00136 public:
00137
00139 virtual void setRadius(float radius) = 0;
00140
00142 virtual float getRadius() const = 0;
00143
00145 virtual void setHeight(float height) = 0;
00146
00148 virtual float getHeight() const = 0;
00149 };
00150
00152 class EmitterGeomBox : public EmitterGeom
00153 {
00154 public:
00155
00157 virtual void setExtents(const PxVec3& extents) = 0;
00158
00160 virtual PxVec3 getExtents() const = 0;
00161 };
00162
00164 class EmitterGeomExplicit : public EmitterGeom
00165 {
00166 public:
00167
00169 struct PointParams
00170 {
00171 PxVec3 position;
00172 bool doDetectOverlaps;
00173 };
00174
00176 struct SphereParams
00177 {
00178 PxVec3 center;
00179 float radius;
00180 bool doDetectOverlaps;
00181 };
00182
00184 struct EllipsoidParams
00185 {
00186 PxVec3 center;
00187 float radius;
00188 PxVec3 normal;
00189 float polarRadius;
00190 bool doDetectOverlaps;
00191 };
00192
00194 virtual void resetParticleList() = 0;
00195
00202 virtual void addParticleList(uint32_t count,
00203 const PointParams* params,
00204 const PxVec3* velocities = 0) = 0;
00205
00212 virtual void addParticleList(uint32_t count,
00213 const PxVec3* positions,
00214 const PxVec3* velocities = 0) = 0;
00215
00217 struct PointListData
00218 {
00219 const void* positionStart;
00220 uint32_t positionStrideBytes;
00221 const void* velocityStart;
00222 uint32_t velocityStrideBytes;
00223 const void* userDataStart;
00224 uint32_t userDataStrideBytes;
00225 };
00226
00233 virtual void addParticleList(uint32_t count, const PointListData& data) = 0;
00234
00242 virtual void addSphereList(uint32_t count,
00243 const SphereParams* params,
00244 const PxVec3* velocities = 0) = 0;
00245
00253 virtual void addEllipsoidList(uint32_t count,
00254 const EllipsoidParams* params,
00255 const PxVec3* velocities = 0) = 0;
00256
00265 virtual void getParticleList(const PointParams* ¶ms,
00266 uint32_t& numPoints,
00267 const PxVec3* &velocities,
00268 uint32_t& numVelocities) const = 0;
00269
00278 virtual void getSphereList(const SphereParams* ¶ms,
00279 uint32_t& numSpheres,
00280 const PxVec3* &velocities,
00281 uint32_t& numVelocities) const = 0;
00282
00291 virtual void getEllipsoidList(const EllipsoidParams* ¶ms,
00292 uint32_t& numEllipsoids,
00293 const PxVec3* &velocities,
00294 uint32_t& numVelocities) const = 0;
00295
00297 virtual uint32_t getParticleCount() const = 0;
00298
00300 virtual PxVec3 getParticlePos(uint32_t index) const = 0;
00301
00303 virtual uint32_t getSphereCount() const = 0;
00304
00306 virtual PxVec3 getSphereCenter(uint32_t index) const = 0;
00307
00309 virtual float getSphereRadius(uint32_t index) const = 0;
00310
00312 virtual uint32_t getEllipsoidCount() const = 0;
00313
00315 virtual PxVec3 getEllipsoidCenter(uint32_t index) const = 0;
00316
00318 virtual float getEllipsoidRadius(uint32_t index) const = 0;
00319
00321 virtual PxVec3 getEllipsoidNormal(uint32_t index) const = 0;
00322
00324 virtual float getEllipsoidPolarRadius(uint32_t index) const = 0;
00325
00327 virtual float getDistance() const = 0;
00328 };
00329
00330
00331 PX_POP_PACK
00332
00333 }
00334 }
00335
00336 #endif // EMITTER_GEOMS_H