Mercurial > hg > Game > Cerium
annotate Renderer/Engine/SceneGraphRoot.h @ 759:45f7ab7101ea draft
first of all commit, not work Rendering/Test/create_task
author | hiroki |
---|---|
date | Thu, 04 Feb 2010 14:46:09 +0900 |
parents | 77f936380930 |
children | c0a8af52fa43 |
rev | line source |
---|---|
283 | 1 #ifndef INCLUDED_SCENE_GRAPH_ROOT |
2 #define INCLUDED_SCENE_GRAPH_ROOT | |
3 | |
539 | 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 |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
17 class SceneGraphRoot; |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
18 typedef void (*regist_func)(SceneGraphRoot *sgroot); |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
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
341f1f881a9b
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
30 // Static Singleton |
341f1f881a9b
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
31 // SceneGraphPtr *sg_src; |
341f1f881a9b
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
32 // int sg_src_length; |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
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 // 光源のオブジェクト |
747 | 59 SceneGraphPtr light; |
60 // 光源の疑似 xml file | |
61 float light_vector[4]; | |
597 | 62 |
283 | 63 // SceneGraphIterator |
64 SceneGraphIteratorPtr iterator; | |
65 | |
747 | 66 // fd of Linda taple space |
67 int tid; | |
591 | 68 |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
69 // move task test flag |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
70 int move_finish_flag; |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
71 |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
72 // 関数ポインタ |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
73 regist_func regist; |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
74 // application で実行する task |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
75 HTaskPtr move_exec_task; |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
76 |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
77 // とりあえず |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
78 int screen_w; |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
79 int screen_h; |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
80 |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
81 |
283 | 82 /** |
83 * Functions | |
84 */ | |
85 /* User API */ | |
539 | 86 void createFromXMLfile(TaskManager *manager, const char *); |
580
ec9dd24c2dc8
add all object in file in dynamic_create
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
575
diff
changeset
|
87 void createFromXMLmemory(TaskManager *manager, SceneGraph * node, char *data, int len); |
283 | 88 SceneGraphPtr createSceneGraph(int id); |
558 | 89 SceneGraphPtr createSceneGraph(); |
562 | 90 SceneGraphPtr createSceneGraph(const char *name); |
91 int getSgid(const char *name); | |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
92 void appTaskRegist(regist_func new_regist); |
562 | 93 |
283 | 94 void setSceneData(SceneGraphPtr sg); |
558 | 95 Pad *getController(); |
96 SceneGraphIteratorPtr getIterator(); | |
283 | 97 SceneGraphIteratorPtr getIterator(SceneGraphPtr list); |
558 | 98 CameraPtr getCamera(); |
747 | 99 SceneGraphPtr getLight(); |
100 float* getLightVector(); | |
283 | 101 |
102 /* Other System API */ | |
103 void allExecute(int screen_w, int screen_h); | |
758 | 104 void oneExecute(int screen_w, int screen_h); |
558 | 105 void checkRemove(); |
106 SceneGraphPtr getExecuteSceneGraph(); | |
107 SceneGraphPtr getDrawSceneGraph(); | |
108 void updateControllerState(); | |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
109 void regist_execute(); |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
110 void move_finish(); |
283 | 111 |
539 | 112 void speExecute(int screen_w, int screen_h); |
562 | 113 void speExecute(int screen_w, int screen_h, Application *app); |
539 | 114 |
283 | 115 /* System API */ |
116 void registSceneGraph(SceneGraphPtr sg); | |
562 | 117 void registSceneGraphList(SceneGraphPtr sg); |
118 void addSceneGraphList(TaskManager *manager, SceneGraphPtr tmp); | |
283 | 119 void addNext(SceneGraphPtr sg); |
120 void allRemove(SceneGraphPtr list); | |
565 | 121 |
575
341f1f881a9b
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
122 int getLast() ; |
565 | 123 |
283 | 124 }; |
125 | |
126 typedef SceneGraphRoot *SceneGraphRootPtr; | |
127 | |
128 | |
539 | 129 // 大域変数は無くすこと |
653
7a311860a76e
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
|
130 //extern SceneGraphRoot *sgroot; |
7a311860a76e
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
|
131 //extern SceneGraphRoot *sgroot_A; |
7a311860a76e
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
|
132 //extern SceneGraphRoot *sgroot_B; |
562 | 133 |
134 #endif | |
558 | 135 |
136 /* end */ |