annotate Renderer/Engine/SceneGraphRoot.h @ 597:1bfa45a08fa7 draft

add Light Object
author yutaka@henri.cr.ie.u-ryukyu.ac.jp
date Thu, 05 Nov 2009 20:17:59 +0900
parents 65e52fd2c2e2
children 7a311860a76e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
1 #ifndef INCLUDED_SCENE_GRAPH_ROOT
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
2 #define INCLUDED_SCENE_GRAPH_ROOT
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
3
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
4 #include "SceneGraph.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
5 #include "SceneGraphArray.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
6 #include "Camera.h"
597
1bfa45a08fa7 add Light Object
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents: 591
diff changeset
7 #include "Light.h"
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
8 #include "SceneGraphIterator.h"
562
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
9 #include <sys/types.h>
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
10
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
11 typedef struct {
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
12 caddr_t file_mmap;
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
13 off_t size;
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
14 } st_mmap_t;
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
15
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
16 class Application;
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
17
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
18 class SceneGraphRoot {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
19 public:
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
20 /* Constructor, Destructor */
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
21 SceneGraphRoot(float w, float h);
558
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
22 ~SceneGraphRoot();
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
23
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
24 /* Variables */
562
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
25 TaskManager *tmanager;
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
26
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
27 // xml から読み込んだ、オリジナルの SceneGraph
575
341f1f881a9b Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 565
diff changeset
28 // Static Singleton
341f1f881a9b Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 565
diff changeset
29 // SceneGraphPtr *sg_src;
341f1f881a9b Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 565
diff changeset
30 // int sg_src_length;
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
31
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
32 // move, collision 用の SceneGraph (tree)
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
33 SceneGraphPtr sg_exec_tree;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
34
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
35 // 描画用の SceneGraph List (tree)
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
36 SceneGraphPtr sg_draw_tree;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
37
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
38 // sg_exec_tree に対応する list
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
39 SceneGraphPtr sg_available_list;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
40
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
41 // sg_draw_tree に対応する list
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
42 // draw_tree は描画後削除される
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
43 SceneGraphPtr sg_remove_list;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
44
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
45 SceneGraphArrayPtr sg_array1;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
46 SceneGraphArrayPtr sg_array2;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
47 SceneGraphArrayPtr sg_curArray;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
48
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
49 // コントローラーオブジェクト (Keyboard, Joystick, ..)
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
50 Pad *controller;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
51
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
52 // カメラオブジェクト
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
53 Camera *camera;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
54
597
1bfa45a08fa7 add Light Object
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents: 591
diff changeset
55 // 光源のオブジェクト
1bfa45a08fa7 add Light Object
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents: 591
diff changeset
56 Light *light;
1bfa45a08fa7 add Light Object
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents: 591
diff changeset
57
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
58 // SceneGraphIterator
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
59 SceneGraphIteratorPtr iterator;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
60
591
65e52fd2c2e2 send linda not work...
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents: 580
diff changeset
61 // fd of Linda taple space
65e52fd2c2e2 send linda not work...
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents: 580
diff changeset
62 int tid;
65e52fd2c2e2 send linda not work...
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents: 580
diff changeset
63
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
64 /**
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
65 * Functions
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
66 */
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
67 /* User API */
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
68 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
69 void createFromXMLmemory(TaskManager *manager, SceneGraph * node, char *data, int len);
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
70 SceneGraphPtr createSceneGraph(int id);
558
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
71 SceneGraphPtr createSceneGraph();
562
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
72 SceneGraphPtr createSceneGraph(const char *name);
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
73 int getSgid(const char *name);
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
74
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
75 void setSceneData(SceneGraphPtr sg);
558
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
76 Pad *getController();
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
77 SceneGraphIteratorPtr getIterator();
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
78 SceneGraphIteratorPtr getIterator(SceneGraphPtr list);
558
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
79 CameraPtr getCamera();
597
1bfa45a08fa7 add Light Object
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents: 591
diff changeset
80 LightPtr getLight();
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
81
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
82 /* Other System API */
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
83 void allExecute(int screen_w, int screen_h);
558
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
84 void checkRemove();
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
85 SceneGraphPtr getExecuteSceneGraph();
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
86 SceneGraphPtr getDrawSceneGraph();
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
87 void updateControllerState();
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
88
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
89 void speExecute(int screen_w, int screen_h);
562
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
90 void speExecute(int screen_w, int screen_h, Application *app);
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
91
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
92 /* System API */
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
93 void registSceneGraph(SceneGraphPtr sg);
562
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
94 void registSceneGraphList(SceneGraphPtr sg);
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
95 void addSceneGraphList(TaskManager *manager, SceneGraphPtr tmp);
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
96 void addNext(SceneGraphPtr sg);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
97 void allRemove(SceneGraphPtr list);
565
5193d51294a2 linda API
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 562
diff changeset
98
575
341f1f881a9b Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 565
diff changeset
99 int getLast() ;
565
5193d51294a2 linda API
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 562
diff changeset
100
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
101 };
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
102
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
103 typedef SceneGraphRoot *SceneGraphRootPtr;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
104
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
105
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
106 // 大域変数は無くすこと
562
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
107 extern SceneGraphRoot *sgroot;
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
108
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
109 #endif
558
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
110
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
111 /* end */