Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/SceneGraph.h @ 927:651251d56f36
remove garbage codes from viewerGL
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 30 Jul 2010 17:57:49 +0900 |
parents | f525427ae30f |
children | 35efda39c2d9 |
rev | line source |
---|---|
283 | 1 #ifndef INCLUDED_SCENE_GRAPH |
2 #define INCLUDED_SCENE_GRAPH | |
3 | |
507 | 4 #include "polygon.h" |
5 #include "Pad.h" | |
6 #include "TaskManager.h" | |
283 | 7 class SceneGraph; |
8 | |
656
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
9 //typedef void (*move_func)(SceneGraph* node, int screen_w, int screen_h); |
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
10 typedef void (*move_func)(SceneGraph* node, void *sgroot, int screen_w, int screen_h); |
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
11 //typedef void (*collision_func)(SceneGraph* node, int screen_w, int screen_h, |
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
12 // SceneGraph* tree); |
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
13 typedef void (*collision_func)(SceneGraph* node, void *sgroot, int screen_w, int screen_h, |
507 | 14 SceneGraph* tree); |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
724
diff
changeset
|
15 typedef void (*create_sg_func)(void *sgroot, void *property, void *update_property); |
283 | 16 typedef SceneGraph* SceneGraphPtr; |
17 | |
18 class SceneGraph : public Polygon { | |
19 public: | |
20 SceneGraph(void); | |
507 | 21 SceneGraph(TaskManager *manager, xmlNodePtr surface); |
283 | 22 SceneGraph(SceneGraphPtr orig); |
23 ~SceneGraph(void); | |
24 | |
656
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
25 // add |
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
26 void *sgroot; |
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
27 |
283 | 28 // Node がもつ状態変数(というべきか否か |
29 // xyz,angle ぐらいあればおk? | |
30 float stack_xyz[3]; | |
31 float stack_angle[3]; | |
507 | 32 int id; |
593
6f741ab60749
sending and moving of multi xml work (linda)
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents:
507
diff
changeset
|
33 // Objectのシーケンス番号(Linda) |
6f741ab60749
sending and moving of multi xml work (linda)
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents:
507
diff
changeset
|
34 // とりあえず動かしたいので追加 |
847
8c78d15ea999
replace rd() to wait_rd(). and if reply of wait_rd() is NULL, client request one more rd(). for wait_rd() cannot get last changed tuple.
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
843
diff
changeset
|
35 int seq, seq_rd, resend_flag; |
860 | 36 |
507 | 37 int property_size; |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
724
diff
changeset
|
38 void *propertyptr; |
882 | 39 int move_id; |
40 int coll_id; | |
41 PostFunction post_func; | |
767 | 42 memaddr property; |
769
2a00c1f470b7
add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
767
diff
changeset
|
43 memaddr update_property; |
2a00c1f470b7
add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
767
diff
changeset
|
44 |
283 | 45 |
46 // xml ファイルから生成した時のオブジェクトリスト | |
47 SceneGraphPtr next; | |
48 SceneGraphPtr prev; | |
49 SceneGraphPtr last; | |
50 | |
51 // Tree Structure | |
52 SceneGraphPtr parent; | |
53 SceneGraphPtr brother; | |
54 SceneGraphPtr children; | |
55 SceneGraphPtr lastChild; | |
56 | |
57 // Tree から削除されていたら 1 をセット。default = 0 | |
58 int flag_remove; | |
59 | |
60 // SceneGraph ID (SGList.h) | |
61 int sgid; | |
62 | |
63 // この SceneGraph は描画するものかどうか (0:しない 1:する | |
64 int flag_drawable; | |
65 | |
66 // anime frame num | |
67 int frame; | |
68 | |
507 | 69 // Group ID |
70 int gid; | |
71 | |
283 | 72 // 関数ポインタ |
73 move_func move; | |
74 collision_func collision; | |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
724
diff
changeset
|
75 create_sg_func create_sg; |
283 | 76 |
77 // desutroctor で呼ばれる | |
78 void (SceneGraph::*finalize)(void); | |
79 | |
80 void init(void); | |
81 void finalize_original(void); | |
82 void finalize_copy(void); | |
83 void move_execute(int screen_w, int screen_h); | |
84 void collision_check(int screen_w, int screen_h, SceneGraphPtr tree); | |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
724
diff
changeset
|
85 void create_sg_execute(); |
283 | 86 void all_execute(int screen_w, int screen_h); |
87 | |
88 void add_next(SceneGraphPtr next); | |
89 SceneGraphPtr addChild(SceneGraphPtr child); | |
90 SceneGraphPtr addBrother(SceneGraphPtr bro); | |
91 SceneGraphPtr clone(void); | |
92 SceneGraphPtr clone(void *buf); | |
93 SceneGraphPtr searchSceneGraph(const char *name); | |
94 void set_move_collision(move_func new_move, collision_func new_collision); | |
656
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
95 void set_move_collision(move_func new_move, collision_func new_collision, void *sgroot); |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
724
diff
changeset
|
96 void set_move_collision(move_func new_move, collision_func new_collision, create_sg_func new_create_sg); |
283 | 97 void remove(void); |
98 SceneGraphPtr realRemoveFromTree(SceneGraphPtr tree); | |
99 SceneGraphPtr realRemoveFromList(SceneGraphPtr list); | |
100 int isRemoved(void); | |
101 | |
102 static SceneGraphPtr createSceneGraph(int id); | |
103 | |
104 void translate(float x, float y, float z); | |
105 void translateX(float x); | |
106 void translateY(float y); | |
107 void translateZ(float z); | |
108 | |
109 | |
110 void tree_check(void); | |
111 void print_member(void); | |
507 | 112 void get_data(TaskManager *manager, xmlNodePtr cur); |
283 | 113 void delete_data(void); |
507 | 114 |
115 SDL_Surface* load_decode_image(char *image_name, xmlNodePtr cur); | |
116 int makeTapestries(TaskManager *manager, SDL_Surface *texture_image, int id); | |
117 void get_image(TaskManager *manager, xmlNodePtr cur); | |
283 | 118 }; |
119 | |
120 #endif | |
121 | |
507 | 122 // 帯域変数を使うのは禁止なので削除すること |
283 | 123 // オリジナル (Linked List) |
124 extern SceneGraphPtr scene_graph; | |
125 | |
126 // 描画用 (同じオブジェクトが複数ある) Tree | |
127 extern SceneGraphPtr scene_graph_view; |