Morph-SynRJ
view efx_equa.h @ 0:22de913c2d84
morph-synrj intro
| author | "Cedric Pinson <cedric.pinson@alcove.fr> <mornifle@plopbyte.net>" |
|---|---|
| date | Tue Nov 27 15:23:52 2007 +0100 (2007-11-27) |
| parents | |
| children |
line source
1 #ifndef EFX_EQUA_H
2 #define EFX_EQUA_H
4 #include "mth_vector3.h"
5 #include "gl_header.h"
7 #define EQUA_DEPTH 30
8 #define EQUA_SIZE_X 5
9 #define EQUA_SIZE_Y 5
10 #define EQUA_DEPTH_OFFSET 15 // define the size of the top of equa
11 #define EQUA_SIZE_SPACE 4.0
14 struct efxEquaBox_t
15 {
16 mth::Vector3_t x;
17 mth::Vector3_t y;
18 mth::Vector3_t z;
19 mth::Vector3_t z2;
21 float level;
22 float baseLevel;
23 mth::Vector3_t vertexes[8];
25 void Init(const mth::Vector3_t& _pos);
27 // between 0-1
28 void SetDepthLevel(float _level);
30 // draw a box
31 void DrawQuad(int _number,float _nx,float _ny);
32 void Draw();
33 void SetBaseLevel(float _level) { baseLevel=_level;}
34 };
38 class efxEqua_t
39 {
41 efxEquaBox_t* box;
42 int resolution;
43 float lightIntensity;
44 float pos[3];
46 public:
48 efxEqua_t();
50 void Kill();
52 int NbElements() { return resolution*resolution;}
53 int ResX() { return resolution;}
54 int ResY() { return resolution;}
57 void SetPosition(float _x,float _y,float _z) { pos[0]=_x;pos[1]=_y;pos[2]=_z;}
59 void SetDepthLevel(int _i,float _level);
61 efxEquaBox_t& GetBox(int _i) { return box[_i];}
63 // init the classe with the number of elements to use
64 void Init(int _resolution);
66 void Update(){}
69 // Draw
70 void Draw(/*GLenum _mode=GL_QUADS*/);
73 };
76 #endif
