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