Eulerian Smoke Simulation on the GPU
include/Obstacle.h
Go to the documentation of this file.
00001 #ifndef __OBSTACLE_H__
00002 #define __OBSTACLE_H__
00003 
00004 //---------------------------------------------------------------------
00007 //---------------------------------------------------------------------
00008 
00009 #include <ngl/Vector.h>
00010 #include "ImplicitSurface.h"
00011 #include "Texture3D.h"
00012 
00020 class Obstacle
00021 {
00022 public:
00024   enum SurfaceType{
00025                     NONE,
00026                     SPHERE,
00027                     TORUS,
00028                     CAYLEY
00029                   };
00030 
00035   Obstacle(
00036             int _resX,
00037             int _resY,
00038             int _resZ,
00039             int _samplerIndex
00040           );
00041 
00043   ~Obstacle();
00044 
00046   void createObject(
00047                     SurfaceType _surfaceType
00048                    );
00049 
00051   inline int getResX() const {return m_resX;}
00053   inline int getResY() const {return m_resY;}
00055   inline int getResZ() const {return m_resZ;}
00056 
00058   inline Texture3D* getTexture() const {return m_obstacleTexture;}
00059 
00061   inline ngl::Vector* getSimData() const {return &m_obstacleSimData[0];}
00062 
00063 private:
00065   int m_resX;
00067   int m_resY;
00069   int m_resZ;
00070 
00072   ImplicitSurface* m_implicitSurf;
00074   Texture3D* m_obstacleTexture;
00075 
00077   ngl::Vector* m_obstacleSimData;
00078 
00079 private:
00081   void createBoundary();
00082 
00083 
00088   inline int index1D(
00089                       int _i,
00090                       int _j,
00091                       int _k
00092                     )
00093                     {
00094                       return _i + _j*m_resX + _k*m_resX*m_resY;
00095                     }
00096 };
00097 
00098 #endif // __OBSTACLE_H__
 All Classes Files Functions Variables