| 1 |
#ifndef CCAMERA_H_INCLUDED |
| 2 |
#define CCAMERA_H_INCLUDED |
| 3 |
|
| 4 |
#include "CModelInst.h" |
| 5 |
|
| 6 |
/* |
| 7 |
* カメラ |
| 8 |
*/ |
| 9 |
class CCamera{ |
| 10 |
private: |
| 11 |
static CCamera *ms_CurrentCamera; // 現在のカメラ |
| 12 |
int m_LeftState; // 左ボタン状態 |
| 13 |
int m_MiddleState; // 中ボタン状態 |
| 14 |
int m_RightState; // 右ボタン状態 |
| 15 |
int m_PrintInfoTime; // 情報表示時間 |
| 16 |
float m_Head, m_Pitch; // 角度 |
| 17 |
// float m_Bank; // バンク未使用 |
| 18 |
float m_Dist; // 距離 |
| 19 |
float m_Wheel; // ホイール |
| 20 |
float m_UpDown; // 上下移動 |
| 21 |
float m_DefDist; // 既定距離 |
| 22 |
float m_MinDist, m_MaxDist; // 最小・最大距離 |
| 23 |
float m_FieldOfView; // 視野角 |
| 24 |
float m_FieldOfViewEffect; // 実効視野角 |
| 25 |
float m_AutoZoomBaseDist; // 自動ズーム基準距離 |
| 26 |
float m_FocusSpeed; // フォーカス捕捉速度 |
| 27 |
bool m_LightSwitch; // 照明 ON/OFF |
| 28 |
bool m_LinkLight; // 照明連動 |
| 29 |
bool m_ClipRect; // クリップ設定 |
| 30 |
bool m_LockPos; // 位置固定 |
| 31 |
bool m_AutoZoom; // 自動ズーム |
| 32 |
int m_LocalFocus; // ローカル制御 |
| 33 |
VEC3 m_Focus; // 注視点 |
| 34 |
VEC3 m_FocusTarget; // フォーカス移動先 |
| 35 |
VEC3 m_CameraPos; // カメラ座標 |
| 36 |
VEC3 m_LightDir; // 照明角度 |
| 37 |
CDetectInfo m_FocusInfo; // 注目情報 |
| 38 |
public: |
| 39 |
static CCamera *GetCurrentCamera(){ return ms_CurrentCamera; } |
| 40 |
void Init(float, float, float, bool); |
| 41 |
void ResetCamera(float head = -0.25f*D3DX_PI, |
| 42 |
float pitch = 0.25f*D3DX_PI, float bank = 0.0f, float dist = -1.0f); |
| 43 |
void SetCenter(){ m_Focus = V3ZERO; } |
| 44 |
float GetFieldOfView(){ return m_FieldOfView; } |
| 45 |
VEC3 GetFocus(){ return m_Focus; } |
| 46 |
void SetFocus(VEC3 f){ m_Focus = f; } |
| 47 |
void SetFocusTarget(VEC3, float); |
| 48 |
CNamedObject *GetFocusObject(){ return m_FocusInfo.GetObject(); } |
| 49 |
CModelInst *GetFocusInst(){ return m_FocusInfo.GetModelInst(); } |
| 50 |
CPartsInst *GetFocusParts(){ return m_FocusInfo.GetPartsInst(); } |
| 51 |
void SetFocusInfo(CDetectInfo &); |
| 52 |
bool GetLockPos(){ return m_LockPos; } |
| 53 |
void SetLockPos(bool l){ m_LockPos = l; BeginPrint(); } |
| 54 |
bool GetAutoZoom(){ return m_AutoZoom; } |
| 55 |
void SetAutoZoom(bool); |
| 56 |
int GetLocalFocus(){ return m_LocalFocus; } |
| 57 |
void SetLocalFocus(int, CObject *tlocal = NULL); |
| 58 |
float GetDist(){ return m_Dist; } |
| 59 |
void ResetLight(); |
| 60 |
void SwitchLight(bool f){ m_LightSwitch = f; } |
| 61 |
bool IsLightOn(){ return m_LightSwitch; } |
| 62 |
void LinkLight(bool); |
| 63 |
bool IsLightLinked(){ return m_LinkLight; } |
| 64 |
void InvCalcParam(CObject *tlocal = NULL); |
| 65 |
void Select(); |
| 66 |
void Apply(bool, CObject *tlocal = NULL); |
| 67 |
void ApplyProjection(float, CObject *tlocal = NULL); |
| 68 |
void BeginPrint(){ m_PrintInfoTime = MAXFPS*2; } |
| 69 |
void PrintInfo(bool ext = false); |
| 70 |
void ControlLocal(CObject *tlocal = NULL); |
| 71 |
int ScanInput(int, CObject *tlocal = NULL); |
| 72 |
void Slide(int, CObject *tlocal = NULL); |
| 73 |
char *Read(char *); |
| 74 |
void Save(FILE *, string indent = "\t\t"); |
| 75 |
}; |
| 76 |
|
| 77 |
// 外部グローバル |
| 78 |
extern float g_FovRatio; |
| 79 |
|
| 80 |
#endif |