Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/SceneGraphRoot.h @ 639:70c5c2d2eb24
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 19 Nov 2009 18:45:24 +0900 |
parents | 5c5cd31b9d43 |
children | d0b8860c17f8 |
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" | |
597 | 7 #include "Light.h" |
507 | 8 #include "SceneGraphIterator.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 |
18 class SceneGraphRoot { | |
19 public: | |
20 /* Constructor, Destructor */ | |
21 SceneGraphRoot(float w, float h); | |
558 | 22 ~SceneGraphRoot(); |
283 | 23 |
24 /* Variables */ | |
562 | 25 TaskManager *tmanager; |
26 | |
283 | 27 // xml から読み込んだ、オリジナルの SceneGraph |
575
0f13810d4492
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
28 // Static Singleton |
0f13810d4492
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
29 // SceneGraphPtr *sg_src; |
0f13810d4492
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
30 // int sg_src_length; |
283 | 31 |
32 // move, collision 用の SceneGraph (tree) | |
33 SceneGraphPtr sg_exec_tree; | |
34 | |
35 // 描画用の SceneGraph List (tree) | |
36 SceneGraphPtr sg_draw_tree; | |
37 | |
38 // sg_exec_tree に対応する list | |
39 SceneGraphPtr sg_available_list; | |
40 | |
41 // sg_draw_tree に対応する list | |
42 // draw_tree は描画後削除される | |
43 SceneGraphPtr sg_remove_list; | |
44 | |
45 SceneGraphArrayPtr sg_array1; | |
46 SceneGraphArrayPtr sg_array2; | |
47 SceneGraphArrayPtr sg_curArray; | |
48 | |
49 // コントローラーオブジェクト (Keyboard, Joystick, ..) | |
50 Pad *controller; | |
51 | |
52 // カメラオブジェクト | |
53 Camera *camera; | |
54 | |
597 | 55 // 光源のオブジェクト |
56 Light *light; | |
57 | |
283 | 58 // SceneGraphIterator |
59 SceneGraphIteratorPtr iterator; | |
60 | |
591 | 61 // fd of Linda taple space |
62 int tid; | |
63 | |
283 | 64 /** |
65 * Functions | |
66 */ | |
67 /* User API */ | |
507 | 68 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
|
69 void createFromXMLmemory(TaskManager *manager, SceneGraph * node, char *data, int len); |
283 | 70 SceneGraphPtr createSceneGraph(int id); |
558 | 71 SceneGraphPtr createSceneGraph(); |
562 | 72 SceneGraphPtr createSceneGraph(const char *name); |
73 int getSgid(const char *name); | |
74 | |
283 | 75 void setSceneData(SceneGraphPtr sg); |
558 | 76 Pad *getController(); |
77 SceneGraphIteratorPtr getIterator(); | |
283 | 78 SceneGraphIteratorPtr getIterator(SceneGraphPtr list); |
558 | 79 CameraPtr getCamera(); |
597 | 80 LightPtr getLight(); |
283 | 81 |
82 /* Other System API */ | |
83 void allExecute(int screen_w, int screen_h); | |
558 | 84 void checkRemove(); |
85 SceneGraphPtr getExecuteSceneGraph(); | |
86 SceneGraphPtr getDrawSceneGraph(); | |
87 void updateControllerState(); | |
283 | 88 |
507 | 89 void speExecute(int screen_w, int screen_h); |
562 | 90 void speExecute(int screen_w, int screen_h, Application *app); |
507 | 91 |
283 | 92 /* System API */ |
93 void registSceneGraph(SceneGraphPtr sg); | |
562 | 94 void registSceneGraphList(SceneGraphPtr sg); |
95 void addSceneGraphList(TaskManager *manager, SceneGraphPtr tmp); | |
283 | 96 void addNext(SceneGraphPtr sg); |
97 void allRemove(SceneGraphPtr list); | |
565 | 98 |
575
0f13810d4492
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
99 int getLast() ; |
565 | 100 |
283 | 101 }; |
102 | |
103 typedef SceneGraphRoot *SceneGraphRootPtr; | |
104 | |
105 | |
507 | 106 // 大域変数は無くすこと |
562 | 107 extern SceneGraphRoot *sgroot; |
108 | |
109 #endif | |
558 | 110 |
111 /* end */ |