#ifndef __WBFOG_H__ #define __WBFOG_H__ #include "texture.h" #include "SceneNode.h" #include "SceneManager.h" #include "3dmath.h" #include #include #include #define INIT_NUM 50 //Lod Size #define LOD_NEAR 2000.0f #define LOD_FAR 60000.0f #define ALPHA_MAX 0xffffffff #define ALPHA_MID 0x80808080 #define D3DFVF_POINTVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE) #define FOGTEX "vfog.dds" //LOD Define enum LODLEVEL{ NOT_SCENE, NEAR_LOD, FAR_LOD }; using namespace std; class CFogScene : public CSceneNode{ public: CFogScene( ); CFogScene(int ); void Create(vector3 ); // particle's system center void SetCenterPos(float x,float y,float z); void SetCenterPos(vector3 ); //particle node pos void SetPos(); void SetPos(int ); void SetPos(int ,float ,float ,float ); // ÁýÁßµµ void SetCenter(float ); void Render(); void SetPick(bool b) {m_bPick = b;} // ÃÖÀú °è¼ö void SetFlow(float ); void SetFlow(float ,int ); // color set void SetColor(float ,float ,float ,float ); void SetColor(float ,float ,float ,float ,int p_index); // ¼¼ºÎ Ä÷¯(¹öÅØ½º °¹¼ö) void SetVertexColor(float ,float ,float ,float ,int dimension); // gravity set void SetGravity(float ,float ,float ); // speed set void SetSpeed(float ,float ,float ); void SetSpeed(float ,float ,float ,int ); void SetSpeed(); //bfade set... void SetEtc(); // set height void SetHeight(float ,int ); void SetHeight(float ); void SetWind(float ,float ,float ); void SetImpress(vector3 imp); void SetImpress(float ,float ,float ); void SetSpeedPower(float ); void Update(float ,float ,float ); void ClosePerson(vector3 ); void ClosePerson(float ,float ,float ); // parameter resetting. void Resetting(); void ChangeVertexBuffer(); void SetSize(float ); void SetBlendMode(DWORD ,DWORD ); void SetRad(float r) { m_Rad = r;} void CreateVertexBuffer(); vector3 GetCenter() {return m_CenterPoint;} void Setfadeout(float ); void Setfadein(float ); void SetBackFadeIn(float f); void SetFadeInSpeed(float s) {m_FadeInSpeed = s;} void SetFadeOutSpeed(float s) {m_FadeOutSpeed = s;} DWORD FtoDW( FLOAT f ) { return *((DWORD*)&f); } ~CFogScene(); private: class POINTVERTEX { public: D3DXVECTOR3 v; D3DCOLOR color; POINTVERTEX() { v.x = v.y = v.z = 0.0f; color = D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f); } ~POINTVERTEX() {} }; // ÆÄƼŬ ±âº» ³ëµå class class ParticleNode{ public: bool Active; // really life float Life; //Alpha value float Fade; // Alpha speed bool bFade; // start fade y/n bool bFadeIn;//fade in y/n bool m_bClose; // ÃÖ´ë fadein/out value //RGB float r[4]; float g[4]; float b[4]; //Position float X; float Y; float Z; // Before Position float BackX; float BackY; float BackZ; // speed float Xi; float Yi; float Zi; // sector position int Sector_X; int Sector_Y; // limit value in y axis float Flow; ParticleNode() { m_bClose = false; } ~ParticleNode() {} }; //render ½Ã »ç¿ëµÇ´Â vertex Á¤º¸ class class ParticleVertex{ public: float x,y,z; DWORD Color; float tx,ty; ParticleVertex() { x = y = z = 0.0f; Color = D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f); tx = ty = 0.0f; } ~ParticleVertex() {} }; // ³»ºÎ º¯¼ö float m_FadeOut; float m_FadeIn; // fade in speed float m_FadeInSpeed; float m_FadeOutSpeed; // ¹Ù¶÷ °è¼ö (Æò¼Ò ¿îµ¿ ¼Óµµ Á¶Àý) float m_Wind[3]; //center ÁýÁßµµ float m_Center; //°¡ÁßÄ¡ vector3 m_Impress; // speed vector = direction vector * Speed_Power float m_SpeedPower; //Áß·Â float m_Gravity[3]; //speed float m_Speed[3]; int m_ParticleNum; int m_ClosePointNum; int m_LodLevel; int m_LodNum; // particle size float m_Size; DWORD m_SrcBlendMode; DWORD m_DstBlendMode; // fog system center. vector3 m_CenterPoint; ParticleVertex *m_pVertex; POINTVERTEX *m_pPoint; ParticleNode *m_Node; //LPDIRECT3DTEXTURE8 *m_TextureId; CTexture *m_BaseTexture; int m_TextureNum; LPDIRECT3DDEVICE8 m_Device; LPDIRECT3DVERTEXBUFFER8 m_FogBuffer; LPDIRECT3DVERTEXBUFFER8 m_FogPointSpriteBuffer; float m_BackFadeIn; float m_Rad; // picking ½Ã ¾²ÀÌ´Â °Í bool m_bPick; int m_Lod; }; class CVfogArg{ public: float m_FadeIn; float m_FadeOut; float m_FadeInSpeed; float m_A1; float m_A2; float m_A3; float m_A4; float m_B1; float m_B2; float m_B3; float m_B4; int m_Center; int m_Num; float m_G1; float m_G2; float m_G3; float m_G4; float m_Gx; float m_Gy; float m_Gz; float m_ImX; float m_ImY; float m_ImZ; float m_R1; float m_R2; float m_R3; float m_R4; float m_Rad; int m_Size; }; #endif