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