Mercurial > hg > Game > Cerium
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 |
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 | 8 #ifndef INCLUDED_PAD |
9 # include "Pad.h" | |
10 #endif | |
11 | |
138 | 12 class SceneGraph; |
13 | |
14 typedef void (*move_func)(SceneGraph* node, int screen_w, int screen_h); | |
15 typedef void (*collision_func)(SceneGraph* node, int screen_w, int screen_h, | |
16 SceneGraph* tree); | |
17 typedef SceneGraph* SceneGraphPtr; | |
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 | 24 ~SceneGraph(void); |
137
91c74dbc32e4
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
25 |
138 | 26 // Node がもつ状態変数(というべきか否か |
27 // xyz,angle ぐらいあればおk? | |
28 float stack_xyz[3]; | |
29 float stack_angle[3]; | |
30 | |
137
91c74dbc32e4
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
31 // xml ファイルから生成した時のオブジェクトリスト |
195 | 32 SceneGraphPtr next; |
33 SceneGraphPtr prev; | |
34 SceneGraphPtr last; | |
137
91c74dbc32e4
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
35 |
138 | 36 // Tree Structure |
195 | 37 SceneGraphPtr parent; |
38 SceneGraphPtr brother; | |
39 SceneGraphPtr children; | |
40 SceneGraphPtr lastChild; | |
137
91c74dbc32e4
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
41 |
195 | 42 // Tree から削除されていたら 1 をセット。default = 0 |
43 int flag_remove; | |
140 | 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 | 58 move_func move; |
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 | 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 | 67 void move_execute(int screen_w, int screen_h); |
195 | 68 void collision_check(int screen_w, int screen_h, SceneGraphPtr tree); |
138 | 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 | 71 void add_next(SceneGraphPtr next); |
72 SceneGraphPtr addChild(SceneGraphPtr child); | |
73 SceneGraphPtr addBrother(SceneGraphPtr bro); | |
74 SceneGraphPtr clone(void); | |
229 | 75 SceneGraphPtr clone(void *buf); |
243 | 76 SceneGraphPtr searchSceneGraph(const char *name); |
195 | 77 void set_move_collision(SceneGraphPtr node, |
138 | 78 move_func new_move, collision_func new_collision); |
142 | 79 void set_move_collision(move_func new_move, collision_func new_collision); |
195 | 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 | 83 int isRemoved(void); |
84 | |
180
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
142
diff
changeset
|
85 static void createFromXMLfile(const char *); |
195 | 86 static SceneGraphPtr createSceneGraph(int id); |
137
91c74dbc32e4
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
87 |
212 | 88 void translate(float x, float y, float z); |
89 void translateX(float x); | |
90 void translateY(float y); | |
91 void translateZ(float z); | |
92 | |
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 | 102 // オリジナル (Linked List) |
137
91c74dbc32e4
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
103 extern SceneGraphPtr scene_graph; |
140 | 104 |
105 // 描画用 (同じオブジェクトが複数ある) Tree | |
106 extern SceneGraphPtr scene_graph_view; |