| 1 |
#ifndef CLENSFLARE_H_INCLUDED |
| 2 |
#define CLENSFLARE_H_INCLUDED |
| 3 |
|
| 4 |
class CNamedObject; |
| 5 |
class CModelPlugin; |
| 6 |
class CHeadlight; |
| 7 |
|
| 8 |
/* |
| 9 |
* レンズフレア要素 |
| 10 |
*/ |
| 11 |
class CFlareElement{ |
| 12 |
friend class CLensFlare; |
| 13 |
private: |
| 14 |
int m_Type; // タイプ |
| 15 |
float m_Distance; // 距離 |
| 16 |
float m_Radius; // 半径 |
| 17 |
D3DCOLOR m_InnerColor; // 内側の色 |
| 18 |
D3DCOLOR m_OuterColor; // 外側の色 |
| 19 |
string m_TexFileName; // テクスチャファイル名 |
| 20 |
LPTEX8 m_Texture; // テクスチャ |
| 21 |
public: |
| 22 |
char *Read(char *); |
| 23 |
void LoadData(); |
| 24 |
bool operator<(const CFlareElement &rhs){ |
| 25 |
return m_Distance<rhs.m_Distance; |
| 26 |
} |
| 27 |
}; |
| 28 |
|
| 29 |
// 反復子 |
| 30 |
typedef list<CFlareElement>::iterator IFlareElement; |
| 31 |
|
| 32 |
/* |
| 33 |
* レンズフレア |
| 34 |
*/ |
| 35 |
class CLensFlare{ |
| 36 |
private: |
| 37 |
float m_StartAngle; // 開始角度 (cos) |
| 38 |
float m_Twinkle; // 点滅度合い |
| 39 |
float m_Inclination; // 角度の傾き |
| 40 |
list<CFlareElement> m_Flare; // フレアリスト |
| 41 |
public: |
| 42 |
char *Read(char *); |
| 43 |
void LoadData(); |
| 44 |
void Render(VEC3, VEC3, VEC3, float, float); |
| 45 |
}; |
| 46 |
|
| 47 |
/* |
| 48 |
* ホワイトアウト |
| 49 |
*/ |
| 50 |
class CWhiteout{ |
| 51 |
private: |
| 52 |
float m_StartAngle; // 開始角度 (cos) |
| 53 |
D3DCOLOR m_Color; // 色 |
| 54 |
public: |
| 55 |
CWhiteout(){ m_Color = 0; } |
| 56 |
char *Read(char *); |
| 57 |
void Render(VEC3, float); |
| 58 |
}; |
| 59 |
|
| 60 |
//////////////////////////////////////////////////////////////////////////////// |
| 61 |
//////////////////////////////////////////////////////////////////////////////// |
| 62 |
|
| 63 |
/* |
| 64 |
* ヘッドライトインスタンス |
| 65 |
*/ |
| 66 |
class CHeadlightInst{ |
| 67 |
friend class CHeadlight; |
| 68 |
private: |
| 69 |
VEC3 m_RenderPos; // レンダリング用光源座標 |
| 70 |
VEC3 m_RenderDir; // レンダリング用光源方向 |
| 71 |
CHeadlight *m_Headlight; // ヘッドライト |
| 72 |
public: |
| 73 |
CHeadlightInst(VEC3, VEC3, CHeadlight *); |
| 74 |
}; |
| 75 |
|
| 76 |
// 反復子 |
| 77 |
typedef list<CHeadlightInst>::iterator IHeadlightInst; |
| 78 |
|
| 79 |
/* |
| 80 |
* ヘッドライト |
| 81 |
*/ |
| 82 |
class CHeadlight{ |
| 83 |
private: |
| 84 |
static list<CHeadlightInst> ms_RenderList; // レンダリングリスト |
| 85 |
float m_MaxDistance; // 最大距離 |
| 86 |
VEC3 m_SourceCoord; // 位置 |
| 87 |
VEC3 m_Direction; // 方向 |
| 88 |
CNamedObject *m_Link; // 接続先オブジェクト |
| 89 |
CLensFlare m_LensFlare; // レンズフレア |
| 90 |
public: |
| 91 |
static void InitRenderList(); |
| 92 |
static void RenderAll(); |
| 93 |
char *Read(char *, CModelPlugin *); |
| 94 |
void LoadData(); |
| 95 |
bool Register(); |
| 96 |
void Render(CHeadlightInst *); |
| 97 |
}; |
| 98 |
|
| 99 |
// 反復子 |
| 100 |
typedef list<CHeadlight>::iterator IHeadlight; |
| 101 |
|
| 102 |
#endif |