Weather.h
上传用户:henghua
上传日期:2007-11-14
资源大小:7655k
文件大小:1k
- #ifndef WEATHER_H
- #define WEATHER_H
- #include "comman.h"
- #ifdef ENABLE_RAIN
- const int numofvtx = 2;
- class CRainParticle
- {
- public:
- D3DXVECTOR3 pos;
- float speed;
- };
- class CRain
- {
- public:
- CRain(LPDIRECT3DDEVICE9 device, CConfiguration *config, int particlenum, D3DXVECTOR3 &v, float radius = 50);
- ~CRain();
- bool Init();
- bool Update(float fElapsedTime = 0.05);
- bool Render();
- int particlenum;
- float radius;
- CConfiguration *config;
- CCamera **cam;
- CRainParticle *particlearray;
- D3DXVECTOR3 dir;
- LPDIRECT3DVERTEXBUFFER9 pRainVB;
- LPDIRECT3DDEVICE9 device;
- };
- #endif
- struct CSnowParticle
- {
- float x, y, z; //位置
- float fYaw; //雪花绕自身Y周旋转角度
- float fPitch; //雪花绕自身X周旋转角度
- float Dspeed; //雪花下降速度
- float Rspeed; //雪花旋转速度
- int TexIndex; //纹理
- };
- class CSnow
- {
- public:
- CSnow(LPDIRECT3DDEVICE9 device, CConfiguration *config, int particlenum, D3DXVECTOR3 &v, float radius = 50);
- ~CSnow();
- bool Init();
- void InitPos();
- bool Update(float fElapsedTime = 0.05);
- bool Render();
- int particlenum;
- float radius;
- bool inited;
- CConfiguration *config;
- CCamera **cam;
- CSnowParticle *particlearray;
- LPDIRECT3DTEXTURE9 pSnowTex[3];
- D3DXVECTOR3 dir;
- LPDIRECT3DVERTEXBUFFER9 pSnowVB;
- LPDIRECT3DDEVICE9 device;
- };
- #endif