annotate TaskManager/Test/test_render/SceneGraph.h @ 341:c3a6cd4fa878 draft

add param gid [SceneGraph.h], func [SceneGraphIterator]
author aaa
date Mon, 29 Jun 2009 20:28:42 +0900
parents c4918a1fb6c9
children 7e045a4cdb77
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
1 #ifndef INCLUDED_SCENE_GRAPH
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
2 #define INCLUDED_SCENE_GRAPH
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
3
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
4 #ifndef INCLUDED_POLYGON
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
5 # include "polygon.h"
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
6 #endif
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
7
140
67a5469dfef2 add Controller
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
8 #ifndef INCLUDED_PAD
67a5469dfef2 add Controller
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
9 # include "Pad.h"
67a5469dfef2 add Controller
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
10 #endif
67a5469dfef2 add Controller
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
11
138
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
12 class SceneGraph;
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
13
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
14 typedef void (*move_func)(SceneGraph* node, int screen_w, int screen_h);
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
15 typedef void (*collision_func)(SceneGraph* node, int screen_w, int screen_h,
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
16 SceneGraph* tree);
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
17 typedef SceneGraph* SceneGraphPtr;
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
18
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
19 class SceneGraph : public Polygon {
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
20 public:
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
21 SceneGraph(void);
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
22 SceneGraph(xmlNodePtr surface);
215
59f4129a9562 fix SceneGraph Constructor, Destructor
gongo@gendarme.local
parents: 212
diff changeset
23 SceneGraph(SceneGraphPtr orig);
140
67a5469dfef2 add Controller
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
24 ~SceneGraph(void);
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
25
138
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
26 // Node がもつ状態変数(というべきか否か
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
27 // xyz,angle ぐらいあればおk?
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
28 float stack_xyz[3];
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
29 float stack_angle[3];
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
30
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
31 // xml ファイルから生成した時のオブジェクトリスト
195
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
32 SceneGraphPtr next;
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
33 SceneGraphPtr prev;
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
34 SceneGraphPtr last;
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
35
138
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
36 // Tree Structure
195
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
37 SceneGraphPtr parent;
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
38 SceneGraphPtr brother;
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
39 SceneGraphPtr children;
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
40 SceneGraphPtr lastChild;
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
41
195
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
42 // Tree から削除されていたら 1 をセット。default = 0
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
43 int flag_remove;
140
67a5469dfef2 add Controller
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
44
202
76bf19f9e305 fix SceneGraphIterator::hasNext(), next()
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
45 // SceneGraph ID (SGList.h)
76bf19f9e305 fix SceneGraphIterator::hasNext(), next()
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
46 int sgid;
76bf19f9e305 fix SceneGraphIterator::hasNext(), next()
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
47
76bf19f9e305 fix SceneGraphIterator::hasNext(), next()
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
48 // この SceneGraph は描画するものかどうか (0:しない 1:する
76bf19f9e305 fix SceneGraphIterator::hasNext(), next()
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
49 int flag_drawable;
76bf19f9e305 fix SceneGraphIterator::hasNext(), next()
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
50
215
59f4129a9562 fix SceneGraph Constructor, Destructor
gongo@gendarme.local
parents: 212
diff changeset
51 // anime frame num
59f4129a9562 fix SceneGraph Constructor, Destructor
gongo@gendarme.local
parents: 212
diff changeset
52 int frame;
59f4129a9562 fix SceneGraph Constructor, Destructor
gongo@gendarme.local
parents: 212
diff changeset
53
341
c3a6cd4fa878 add param gid [SceneGraph.h], func [SceneGraphIterator]
aaa
parents: 243
diff changeset
54 // Group ID
c3a6cd4fa878 add param gid [SceneGraph.h], func [SceneGraphIterator]
aaa
parents: 243
diff changeset
55 int gid;
c3a6cd4fa878 add param gid [SceneGraph.h], func [SceneGraphIterator]
aaa
parents: 243
diff changeset
56
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
57 // 関数ポインタ
138
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
58 move_func move;
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
59 collision_func collision;
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
60
215
59f4129a9562 fix SceneGraph Constructor, Destructor
gongo@gendarme.local
parents: 212
diff changeset
61 // desutroctor で呼ばれる
59f4129a9562 fix SceneGraph Constructor, Destructor
gongo@gendarme.local
parents: 212
diff changeset
62 void (SceneGraph::*finalize)(void);
59f4129a9562 fix SceneGraph Constructor, Destructor
gongo@gendarme.local
parents: 212
diff changeset
63
140
67a5469dfef2 add Controller
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
64 void init(void);
215
59f4129a9562 fix SceneGraph Constructor, Destructor
gongo@gendarme.local
parents: 212
diff changeset
65 void finalize_original(void);
59f4129a9562 fix SceneGraph Constructor, Destructor
gongo@gendarme.local
parents: 212
diff changeset
66 void finalize_copy(void);
138
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
67 void move_execute(int screen_w, int screen_h);
195
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
68 void collision_check(int screen_w, int screen_h, SceneGraphPtr tree);
138
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
69 void all_execute(int screen_w, int screen_h);
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
70
195
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
71 void add_next(SceneGraphPtr next);
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
72 SceneGraphPtr addChild(SceneGraphPtr child);
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
73 SceneGraphPtr addBrother(SceneGraphPtr bro);
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
74 SceneGraphPtr clone(void);
229
e6eb4f8d6b0e add Random class
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 215
diff changeset
75 SceneGraphPtr clone(void *buf);
243
c4918a1fb6c9 rm warning
e065746@localhost.localdomain
parents: 229
diff changeset
76 SceneGraphPtr searchSceneGraph(const char *name);
195
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
77 void set_move_collision(SceneGraphPtr node,
138
f35504025f73 オブジェクトを増やして複数の表示に成功。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
78 move_func new_move, collision_func new_collision);
142
dc68420f705f add xml
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 140
diff changeset
79 void set_move_collision(move_func new_move, collision_func new_collision);
195
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
80 void remove(void);
199
1fd0107ebb25 add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 195
diff changeset
81 SceneGraphPtr realRemoveFromTree(SceneGraphPtr tree);
1fd0107ebb25 add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 195
diff changeset
82 SceneGraphPtr realRemoveFromList(SceneGraphPtr list);
195
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
83 int isRemoved(void);
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
84
180
e3b7776b1420 いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents: 142
diff changeset
85 static void createFromXMLfile(const char *);
195
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 180
diff changeset
86 static SceneGraphPtr createSceneGraph(int id);
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
87
212
gongo@localhost.localdomain
parents: 202
diff changeset
88 void translate(float x, float y, float z);
gongo@localhost.localdomain
parents: 202
diff changeset
89 void translateX(float x);
gongo@localhost.localdomain
parents: 202
diff changeset
90 void translateY(float y);
gongo@localhost.localdomain
parents: 202
diff changeset
91 void translateZ(float z);
gongo@localhost.localdomain
parents: 202
diff changeset
92
gongo@localhost.localdomain
parents: 202
diff changeset
93
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
94 void tree_check(void);
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
95 void print_member(void);
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
96 void get_data(xmlNodePtr cur);
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
97 void delete_data(void);
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
98 };
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
99
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
100 #endif
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
101
140
67a5469dfef2 add Controller
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
102 // オリジナル (Linked List)
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
103 extern SceneGraphPtr scene_graph;
140
67a5469dfef2 add Controller
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
104
67a5469dfef2 add Controller
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
105 // 描画用 (同じオブジェクトが複数ある) Tree
67a5469dfef2 add Controller
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
106 extern SceneGraphPtr scene_graph_view;