APEX Emitter Module: EmitterGeoms.h Source File

NVIDIA APEX

EmitterGeoms.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008-2017, NVIDIA CORPORATION.  All rights reserved.
00003  *
00004  * NVIDIA CORPORATION and its licensors retain all intellectual property
00005  * and proprietary rights in and to this software, related documentation
00006  * and any modifications thereto.  Any use, reproduction, disclosure or
00007  * distribution of this software and related documentation without an express
00008  * license agreement from NVIDIA CORPORATION is strictly prohibited.
00009  */
00010 
00011 
00012 #ifndef EMITTER_GEOMS_H
00013 #define EMITTER_GEOMS_H
00014 
00015 #include "Apex.h"
00016 
00017 namespace nvidia
00018 {
00019 namespace apex
00020 {
00021 
00022 PX_PUSH_PACK_DEFAULT
00023 
00025 struct EmitterType
00026 {
00028     enum Enum
00029     {
00030         ET_RATE = 0,            
00031         ET_DENSITY_ONCE,        
00032         ET_DENSITY_BRUSH,       
00033         ET_FILL,                
00034         ET_UNDEFINED,
00035     };
00036 };
00037 
00038 class EmitterGeomBox;
00039 class EmitterGeomSphere;
00040 class EmitterGeomSphereShell;
00041 class EmitterGeomCylinder;
00042 class EmitterGeomExplicit;
00043 
00045 class EmitterGeom
00046 {
00047 public:
00049     virtual void                            setEmitterType(EmitterType::Enum) = 0;
00050     
00052     virtual EmitterType::Enum               getEmitterType() const = 0;
00053 
00055     virtual const EmitterGeomBox*           isBoxGeom() const
00056     {
00057         return NULL;
00058     }
00059     
00061     virtual const EmitterGeomSphere*        isSphereGeom() const
00062     {
00063         return NULL;
00064     }
00065     
00067     virtual const EmitterGeomSphereShell*   isSphereShellGeom() const
00068     {
00069         return NULL;
00070     }
00071     
00073     virtual const EmitterGeomCylinder*      isCylinderGeom() const
00074     {
00075         return NULL;
00076     }
00077     
00079     virtual const EmitterGeomExplicit*      isExplicitGeom() const
00080     {
00081         return NULL;
00082     }
00083 };
00084 
00086 class EmitterGeomSphereShell : public EmitterGeom
00087 {
00088 public:
00089     
00091     virtual void    setRadius(float radius) = 0;
00092     
00094     virtual float   getRadius() const = 0;
00095 
00097     virtual void    setShellThickness(float thickness) = 0;
00098     
00100     virtual float   getShellThickness() const = 0;
00101 };
00102 
00104 class EmitterGeomSphere : public EmitterGeom
00105 {
00106 public:
00107 
00109     virtual void    setRadius(float radius) = 0;
00110     
00112     virtual float   getRadius() const = 0;
00113 };
00114 
00116 class EmitterGeomCylinder : public EmitterGeom
00117 {
00118 public:
00119 
00121     virtual void    setRadius(float radius) = 0;
00122     
00124     virtual float   getRadius() const = 0;
00125 
00127     virtual void    setHeight(float height) = 0;
00128     
00130     virtual float   getHeight() const = 0;
00131 };
00132 
00134 class EmitterGeomBox : public EmitterGeom
00135 {
00136 public:
00137 
00139     virtual void    setExtents(const PxVec3& extents) = 0;
00140     
00142     virtual PxVec3  getExtents() const = 0;
00143 };
00144 
00146 class EmitterGeomExplicit : public EmitterGeom
00147 {
00148 public:
00149     
00151     struct PointParams
00152     {
00153         PxVec3 position; 
00154         bool doDetectOverlaps; 
00155     };
00156 
00158     struct SphereParams
00159     {
00160         PxVec3 center; 
00161         float radius; 
00162         bool doDetectOverlaps; 
00163     };
00164 
00166     struct EllipsoidParams
00167     {
00168         PxVec3 center; 
00169         float radius; 
00170         PxVec3 normal; 
00171         float polarRadius; 
00172         bool doDetectOverlaps; 
00173     };
00174 
00176     virtual void    resetParticleList() = 0;
00177 
00184     virtual void    addParticleList(uint32_t count,
00185                                     const PointParams* params,
00186                                     const PxVec3* velocities = 0) = 0;
00187 
00194     virtual void    addParticleList(uint32_t count,
00195                                     const PxVec3* positions,
00196                                     const PxVec3* velocities = 0) = 0;
00197 
00199     struct PointListData
00200     {
00201         const void* positionStart;          
00202         uint32_t    positionStrideBytes;    
00203         const void* velocityStart;          
00204         uint32_t    velocityStrideBytes;    
00205         const void* userDataStart;          
00206         uint32_t    userDataStrideBytes;    
00207     };
00208     
00215     virtual void    addParticleList(uint32_t count, const PointListData& data) = 0;
00216 
00224     virtual void    addSphereList(uint32_t count,
00225                                   const SphereParams* params,
00226                                   const PxVec3* velocities = 0) = 0;
00227 
00235     virtual void    addEllipsoidList(uint32_t count,
00236                                      const EllipsoidParams*  params,
00237                                      const PxVec3* velocities = 0) = 0;
00238 
00247     virtual void    getParticleList(const PointParams* &params,
00248                                     uint32_t& numPoints,
00249                                     const PxVec3* &velocities,
00250                                     uint32_t& numVelocities) const = 0;
00251 
00260     virtual void    getSphereList(const SphereParams* &params,
00261                                   uint32_t& numSpheres,
00262                                   const PxVec3* &velocities,
00263                                   uint32_t& numVelocities) const = 0;
00264 
00273     virtual void    getEllipsoidList(const EllipsoidParams* &params,
00274                                      uint32_t& numEllipsoids,
00275                                      const PxVec3* &velocities,
00276                                      uint32_t& numVelocities) const = 0;
00277 
00279     virtual uint32_t    getParticleCount() const = 0;
00280 
00282     virtual PxVec3      getParticlePos(uint32_t index) const = 0;
00283 
00285     virtual uint32_t    getSphereCount() const = 0;
00286 
00288     virtual PxVec3      getSphereCenter(uint32_t index) const = 0;
00289 
00291     virtual float       getSphereRadius(uint32_t index) const = 0;
00292 
00294     virtual uint32_t    getEllipsoidCount() const = 0;
00295 
00297     virtual PxVec3      getEllipsoidCenter(uint32_t index) const = 0;
00298 
00300     virtual float       getEllipsoidRadius(uint32_t index) const = 0;
00301 
00303     virtual PxVec3      getEllipsoidNormal(uint32_t index) const = 0;
00304 
00306     virtual float       getEllipsoidPolarRadius(uint32_t index) const = 0;
00307 
00309     virtual float       getDistance() const = 0;
00310 };
00311 
00312 
00313 PX_POP_PACK
00314 
00315 }
00316 } // end namespace nvidia
00317 
00318 #endif // EMITTER_GEOMS_H

Generated on Fri Dec 15 2017 13:58:27
Copyright © 2012-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.