Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/SceneGraphRoot.h @ 1048:40cde8c1a6cd default tip
add ScaleXY (not for allExecute...)
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 08 Dec 2010 06:22:15 +0900 |
parents | b9cd0c88b69a |
children |
rev | line source |
---|---|
283 | 1 #ifndef INCLUDED_SCENE_GRAPH_ROOT |
2 #define INCLUDED_SCENE_GRAPH_ROOT | |
3 | |
507 | 4 #include "SceneGraph.h" |
5 #include "SceneGraphArray.h" | |
6 #include "Camera.h" | |
7 #include "SceneGraphIterator.h" | |
1003
295b3c79fb44
game_task keep up with task_array.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
1002
diff
changeset
|
8 #include "GTaskArray.h" |
562 | 9 #include <sys/types.h> |
10 | |
11 typedef struct { | |
12 caddr_t file_mmap; | |
13 off_t size; | |
14 } st_mmap_t; | |
15 | |
16 class Application; | |
283 | 17 |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
18 class SceneGraphRoot; |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
19 typedef void (*regist_func)(SceneGraphRoot *sgroot); |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
20 |
283 | 21 class SceneGraphRoot { |
22 public: | |
23 /* Constructor, Destructor */ | |
24 SceneGraphRoot(float w, float h); | |
558 | 25 ~SceneGraphRoot(); |
283 | 26 |
27 /* Variables */ | |
562 | 28 TaskManager *tmanager; |
29 | |
283 | 30 // xml から読み込んだ、オリジナルの SceneGraph |
575
0f13810d4492
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
31 // Static Singleton |
0f13810d4492
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
32 // SceneGraphPtr *sg_src; |
0f13810d4492
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
33 // int sg_src_length; |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
34 SceneGraphPtr list; |
283 | 35 |
36 // move, collision 用の SceneGraph (tree) | |
37 SceneGraphPtr sg_exec_tree; | |
38 | |
39 // 描画用の SceneGraph List (tree) | |
40 SceneGraphPtr sg_draw_tree; | |
41 | |
42 // sg_exec_tree に対応する list | |
43 SceneGraphPtr sg_available_list; | |
44 | |
45 // sg_draw_tree に対応する list | |
46 // draw_tree は描画後削除される | |
47 SceneGraphPtr sg_remove_list; | |
48 | |
49 SceneGraphArrayPtr sg_array1; | |
50 SceneGraphArrayPtr sg_array2; | |
51 SceneGraphArrayPtr sg_curArray; | |
52 | |
53 // コントローラーオブジェクト (Keyboard, Joystick, ..) | |
54 Pad *controller; | |
55 | |
56 // カメラオブジェクト | |
57 Camera *camera; | |
58 | |
597 | 59 // 光源のオブジェクト |
762 | 60 SceneGraphPtr light[4]; |
792 | 61 int light_switch[4]; |
62 int light_sysswitch; | |
678
e201be3f6897
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
656
diff
changeset
|
63 // 光源の疑似 xml file |
762 | 64 // 光源は4つで決め打ち。 |
65 // 4 * lightnum (4) = 16; | |
66 float light_vector[16]; | |
597 | 67 |
283 | 68 // SceneGraphIterator |
69 SceneGraphIteratorPtr iterator; | |
70 | |
678
e201be3f6897
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
656
diff
changeset
|
71 // fd of Linda taple space |
e201be3f6897
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
656
diff
changeset
|
72 int tid; |
591 | 73 |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
74 // move task test flag |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
75 int move_finish_flag; |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
76 |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
77 // 関数ポインタ |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
78 regist_func regist; |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
79 // application で実行する task |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
80 HTaskPtr move_exec_task; |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
81 |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
82 // とりあえず |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
83 int screen_w; |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
84 int screen_h; |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
85 |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
86 |
283 | 87 /** |
88 * Functions | |
89 */ | |
90 /* User API */ | |
507 | 91 void createFromXMLfile(TaskManager *manager, const char *); |
580
da82a47ece92
add all object in file in dynamic_create
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
575
diff
changeset
|
92 void createFromXMLmemory(TaskManager *manager, SceneGraph * node, char *data, int len); |
283 | 93 SceneGraphPtr createSceneGraph(int id); |
558 | 94 SceneGraphPtr createSceneGraph(); |
562 | 95 SceneGraphPtr createSceneGraph(const char *name); |
96 int getSgid(const char *name); | |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
97 void appTaskRegist(regist_func new_regist); |
562 | 98 |
283 | 99 void setSceneData(SceneGraphPtr sg); |
558 | 100 Pad *getController(); |
101 SceneGraphIteratorPtr getIterator(); | |
283 | 102 SceneGraphIteratorPtr getIterator(SceneGraphPtr list); |
558 | 103 CameraPtr getCamera(); |
762 | 104 SceneGraphPtr getLight(int id); |
793 | 105 void OnLightSwitch(int id); |
106 void OffLightSwitch(int id); | |
107 void OnLightSysSwitch(); | |
108 void OffLightSysSwitch(); | |
969
9a53faae88d8
add new function for dandy.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
882
diff
changeset
|
109 |
1003
295b3c79fb44
game_task keep up with task_array.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
1002
diff
changeset
|
110 /* GameTaskArray 生成用 */ |
295b3c79fb44
game_task keep up with task_array.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
1002
diff
changeset
|
111 GTaskArrayPtr gtask_array; |
1002 | 112 void task_array_init(int id, int task_num, int param, int inData_num, int outData_num); |
1003
295b3c79fb44
game_task keep up with task_array.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
1002
diff
changeset
|
113 void create_task_array(); |
1002 | 114 void task_array_finish(); |
1033
431936c0cc96
add application main method and task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
1003
diff
changeset
|
115 void set_gtask_array(int id, void *property, int size, PostFunction post_func); |
431936c0cc96
add application main method and task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
1003
diff
changeset
|
116 void set_gtask_array(int id, void *property, void* pad, int size, PostFunction post_func); |
431936c0cc96
add application main method and task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
1003
diff
changeset
|
117 void set_game_task(int id, void *property, int size); |
431936c0cc96
add application main method and task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
1003
diff
changeset
|
118 void set_game_task(int id, void *property, void *pad, int size); |
431936c0cc96
add application main method and task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
1003
diff
changeset
|
119 void set_move_task(SceneGraphPtr node, int move, void *property, int size); |
431936c0cc96
add application main method and task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
1003
diff
changeset
|
120 void set_pad_task(SceneGraphPtr node, int move, void *property, int size); |
283 | 121 |
122 /* Other System API */ | |
123 void allExecute(int screen_w, int screen_h); | |
1039
b9cd0c88b69a
AllExecute speparation.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1033
diff
changeset
|
124 void lightCalc(); |
b9cd0c88b69a
AllExecute speparation.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1033
diff
changeset
|
125 void flip(); |
b9cd0c88b69a
AllExecute speparation.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1033
diff
changeset
|
126 void copyTree(SceneGraphPtr from, SceneGraphPtr to); |
b9cd0c88b69a
AllExecute speparation.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1033
diff
changeset
|
127 |
b9cd0c88b69a
AllExecute speparation.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1033
diff
changeset
|
128 // void oneExecute(int screen_w, int screen_h); |
558 | 129 void checkRemove(); |
130 SceneGraphPtr getExecuteSceneGraph(); | |
131 SceneGraphPtr getDrawSceneGraph(); | |
132 void updateControllerState(); | |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
133 void regist_execute(); |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
134 void move_finish(); |
793 | 135 float* getLightVector(); |
136 int* getLightSwitch(); | |
137 int getLightSysSwitch(); | |
283 | 138 |
1039
b9cd0c88b69a
AllExecute speparation.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1033
diff
changeset
|
139 // void speExecute(int screen_w, int screen_h); |
b9cd0c88b69a
AllExecute speparation.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1033
diff
changeset
|
140 // void speExecute(int screen_w, int screen_h, Application *app); |
507 | 141 |
283 | 142 /* System API */ |
143 void registSceneGraph(SceneGraphPtr sg); | |
562 | 144 void registSceneGraphList(SceneGraphPtr sg); |
145 void addSceneGraphList(TaskManager *manager, SceneGraphPtr tmp); | |
283 | 146 void addNext(SceneGraphPtr sg); |
147 void allRemove(SceneGraphPtr list); | |
565 | 148 |
575
0f13810d4492
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
149 int getLast() ; |
565 | 150 |
283 | 151 }; |
152 | |
153 typedef SceneGraphRoot *SceneGraphRootPtr; | |
154 | |
155 | |
507 | 156 // 大域変数は無くすこと |
656
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
597
diff
changeset
|
157 //extern SceneGraphRoot *sgroot; |
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
597
diff
changeset
|
158 //extern SceneGraphRoot *sgroot_A; |
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
597
diff
changeset
|
159 //extern SceneGraphRoot *sgroot_B; |
562 | 160 |
161 #endif | |
558 | 162 |
163 /* end */ |