Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/CTrainSetBuffer.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations) (download) (as text)
Sun Aug 15 01:53:13 2010 UTC (13 years, 9 months ago) by okadu
File MIME type: text/x-chdr
File size: 2034 byte(s)


1 #ifndef CTRAINSETBUFFER_H_INCLUDED
2 #define CTRAINSETBUFFER_H_INCLUDED
3
4 class CRailWay;
5 class CAxleObject;
6
7 /*
8 * 車軸姿勢バッファ
9 */
10 class CAxlePosture{
11 friend class CTrain;
12 friend class CTrainGroup;
13 private:
14 float m_Rotation; // 回転量
15 float m_Distance; // 走行距離
16 bool m_Terminate; // 端フラグ
17 VEC3 m_Pos; // 座標
18 VEC3 m_Right; // right
19 VEC3 m_Up; // up
20 VEC3 m_Dir; // dir
21 CRailWay *m_Rail; // レール
22 CAxleObject *m_Axle; // 車軸
23 CTrain *m_Train; // 車輌
24 public:
25 CAxlePosture(CAxleObject *, CTrain *, bool);
26 void SetPosture(VEC3, VEC3, VEC3, CRailWay *);
27 float GetZPos();
28 void Apply();
29 void Rotate(float, bool);
30 };
31
32 // 反復子
33 typedef list<CAxlePosture>::iterator IAxlePosture;
34
35 /*
36 * 車輌配置バッファ
37 */
38 class CTrainSetBuffer{
39 friend class CRailWay;
40 friend class CTrainSetCurve;
41 friend class CTrainGroup;
42 private:
43 float m_SumLen; // 積算距離
44 bool m_Reverse; // 反転フラグ
45 CAxlePosture *m_Posture; // 姿勢バッファ
46 public:
47 CTrainSetBuffer(float, bool, CAxlePosture *);
48 bool operator<(const CTrainSetBuffer &rhs) const{ return m_SumLen<rhs.m_SumLen; }
49 void SetPosture(VEC3 pos, VEC3 dir, VEC3 up, CRailWay *way){
50 if(m_Posture) m_Posture->SetPosture(pos, m_Reverse ? -dir : dir, up, way);
51 }
52 void Rotate(float dist){
53 if(m_Posture) m_Posture->Rotate(dist, m_Reverse);
54 }
55 };
56
57 // 反復子
58 typedef list<CTrainSetBuffer>::iterator ITrainSetBuffer;
59
60 /*
61 * 編成終端情報
62 */
63 class CGroupEndLocator{
64 public:
65 int m_Side; // サイド
66 int m_Type; // タイプ (0: front, 1: tail, 2: seeker)
67 float m_Offset; // オフセット
68 CRailWay *m_SetRail; // 設置レール
69 CTrainGroup *m_Group; // 編成
70 public:
71 CGroupEndLocator();
72 CGroupEndLocator(int, float, CRailWay *, CTrainGroup *);
73 void Attach(int);
74 void Detach();
75 int GetDirection();
76 void RestoreAddress();
77 char *Read(char *, char *);
78 void Save(FILE *, char *, char *);
79 };
80
81 // 反復子
82 typedef list<CGroupEndLocator *>::iterator IPGroupEndLocator;
83
84 #endif

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