Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/CModelInst.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations) (download) (as text)
Tue Nov 23 14:34:03 2010 UTC (13 years, 5 months ago) by okadu
File MIME type: text/x-chdr
File size: 3259 byte(s)
[okadu] Version 2.13
1 #ifndef CMODELINST_H_INCLUDED
2 #define CMODELINST_H_INCLUDED
3
4 #include "CModelPlugin.h"
5 #include "CPartsInst.h"
6
7 class CTrainGroup;
8 class CCursorSceneryMode;
9
10 /*
11 * 検出情報
12 */
13 class CDetectInfo{
14 private:
15 CNamedObject *m_Object;
16 CModelInst *m_ModelInst;
17 CPartsInst *m_PartsInst;
18 public:
19 CDetectInfo(){
20 m_Object = NULL; m_ModelInst = NULL; m_PartsInst = NULL;
21 }
22 CDetectInfo(CNamedObject *no, CModelInst *mi, CPartsInst *pi){
23 m_Object = no; m_ModelInst = mi; m_PartsInst = pi;
24 }
25 CNamedObject *GetObject(){ return m_Object; }
26 CModelInst *GetModelInst(){ return m_ModelInst; }
27 CPartsInst *GetPartsInst(){ return m_PartsInst; }
28 };
29
30 /*
31 * モデルインスタンス
32 */
33 class CModelInst{
34 friend class CModelPlugin;
35 protected:
36 static int ms_DetectMode; // 検出モード
37 static int ms_DetectTemp;
38 static float ms_MinDist; // 最小検出距離
39 static VEC3 ms_DetectRect1; // 領域始点
40 static VEC3 ms_DetectRect2; // 領域終点
41 static BOX8 ms_FocusBox; // フォーカスボックス
42 static CModelInst *ms_CurrentInst; // 対象インスタンス
43 static CDetectInfo ms_DetectInfo; // 検出情報
44 vector<int> m_StaticSwitchID; // 同期用スイッチ ID リスト
45 vector<int> m_SwitchOption; // スイッチ設定値
46 int m_Selected; // 選択フラグ
47 VEC3 m_Pos; // 中心座標
48 VEC3 m_Right, m_Up, m_Dir; // 姿勢
49 list<CPartsInst> m_PartsInst; // パーツインスタンス
50 list<CTexAnimState> m_AnimationState; // アニメーション状態
51 list<CMoverState> m_MoverState; // ムーバー状態
52 list<CParticleState> m_ParticleState; // パーティクルエミッタ状態
53 list<CSoundState> m_SoundState; // サウンド状態
54 CModelPlugin *m_ModelPlugin; // モデルプラグイン
55 public:
56 static void ResetDetect(int, VEC3, VEC3);
57 static void CheckDetect(CNamedObject *, CPartsInst *);
58 static bool IsDetected(){ return ms_MinDist>=0.0f; }
59 static float GetMinDist(){ return ms_MinDist; }
60 static CDetectInfo GetDetectInfo(){ return ms_DetectInfo; }
61 static CModelInst *GetCurrentInst(){ return ms_CurrentInst; }
62 CModelInst();
63 CModelInst(CModelPlugin *);
64 virtual ~CModelInst();
65 virtual bool IsSelectVisible(){ return false; }
66 CModelPlugin *GetModelPlugin(){ return m_ModelPlugin; }
67 void AttachPlugin(CModelPlugin *);
68 void SetSwitchOption(int, int);
69 virtual CTrainGroup *GetTrainGroup(){ return NULL; }
70 int GetSelectFlag(){ return m_Selected; }
71 void AddSelectFlag(int sel){ m_Selected |= sel; }
72 void SetSelectFlag(int sel){ m_Selected = sel; }
73 VEC3 GetPos(){ return m_Pos; }
74 VEC3 GetRight(){ return m_Right; }
75 VEC3 GetUp(){ return m_Up; }
76 VEC3 GetDir(){ return m_Dir; }
77 IPartsInst BeginParts(){ return m_PartsInst.begin(); }
78 virtual CPartsInst *FindParts(CNamedObject *){ return NULL; }
79 void StopSound();
80 void SetLocalAxis();
81 void FixPosture(VEC3, VEC3, VEC3);
82 void ResetState();
83 void Simulate();
84 virtual bool IsWarping(){ return false; }
85 virtual void SimulateModelInst() = 0;
86 virtual void PrintInfo() = 0;
87 virtual CModelInst *Control() = 0;
88 virtual CScene *GetScene() = 0;
89 char *ReadModelInst(char *, bool);
90 void SaveModelInst(FILE *, char *, bool);
91 };
92
93 #define CMODELINST_CASTFUNC(type) \
94 type *Next(){ return m_Next; } \
95 type **NextAdr(){ return &m_Next; }
96
97 #endif

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26