annotate TaskManager/Test/test_render/SceneGraphRoot.cpp @ 397:a4f690f44842

delete manager (in kernel/ppe/TaskManager.h) don't move.
author game@henri.cr.ie.u-ryukyu.ac.jp
date Sun, 20 Sep 2009 18:55:26 +0900
parents d1f1e27d0a12
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
1 #include <SDL.h>
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
2 #include <SDL_image.h>
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
3 #include <libxml/parser.h>
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
4 #include "SceneGraphRoot.h"
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
5 #include "xml.h"
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
6 #include "sys.h"
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
7 #include "TextureHash.h"
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
8 #include "texture.h"
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
9 #include "SGList.h"
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
10
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
11 int cnt = 0;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
12
221
d61fded0729e Cameraの設定、Makefile 修正
gongo@gendarme.local
parents: 219
diff changeset
13 SceneGraphRoot::SceneGraphRoot(float w, float h)
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
14 {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
15 sg_src = new SceneGraphPtr[SGLIST_LENGTH];
221
d61fded0729e Cameraの設定、Makefile 修正
gongo@gendarme.local
parents: 219
diff changeset
16 camera = new Camera(w, h);
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
17 iterator = new SceneGraphIterator;
221
d61fded0729e Cameraの設定、Makefile 修正
gongo@gendarme.local
parents: 219
diff changeset
18 controller = create_controller();
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 196
diff changeset
19
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
20 sg_exec_tree = NULL;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
21 sg_draw_tree = NULL;
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
22 sg_available_list = NULL;
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
23 sg_remove_list = NULL;
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 196
diff changeset
24
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 196
diff changeset
25 // TODO
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 196
diff changeset
26 // 今はとりあえず camera を Root にしています
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
27 // 今はそれすらもしてません
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
28 //sg_exec_tree = camera;
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
29 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
30
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
31 SceneGraphRoot::~SceneGraphRoot(void)
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
32 {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
33 SceneGraphPtr p = sg_available_list;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
34
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
35 while (p) {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
36 SceneGraphPtr tmp = p->next;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
37 delete p;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
38 p = tmp;
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
39 cnt--;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
40 }
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
41
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
42 p = sg_remove_list;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
43
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
44 while (p) {
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
45 SceneGraphPtr tmp = p->next;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
46 delete p;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
47 p = tmp;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
48 cnt--;
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
49 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
50
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
51 delete [] sg_src;
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 196
diff changeset
52 delete camera;
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
53 delete iterator;
221
d61fded0729e Cameraの設定、Makefile 修正
gongo@gendarme.local
parents: 219
diff changeset
54 delete controller;
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
55 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
56
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
57 /**
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
58 * xml ファイルから生成された SceneGraph を sg_src に登録する。
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
59 *
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
60 * @param sg SceneGraph created by xmlfile
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
61 */
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
62 void
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
63 SceneGraphRoot::registSceneGraph(SceneGraphPtr sg)
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
64 {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
65 for (int i = 0; i < SGLIST_LENGTH; i++) {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
66 if (strcmp(sg->name, sglist_table[i]) == 0) {
215
7ca6a2ef5be9 fix SceneGraph Constructor, Destructor
gongo@gendarme.local
parents: 213
diff changeset
67 sg->sgid = i;
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
68 sg_src[i] = sg;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
69 return;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
70 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
71 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
72
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
73 fprintf(stderr, "error: (%s:%3d) Can't find Scene \"%s\"\n",
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
74 __FUNCTION__, __LINE__, sg->name);
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
75 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
76
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
77 void
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
78 SceneGraphRoot::addNext(SceneGraphPtr sg)
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
79 {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
80 SceneGraphPtr last = sg_available_list;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
81
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
82 if (!last) {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
83 sg_available_list = sg;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
84 } else {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
85 while (last->next) {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
86 last = last->next;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
87 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
88 last->next = sg;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
89 sg->prev = last;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
90 }
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
91
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
92 cnt++;
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
93 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
94
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
95 /* XMLファイルからポリゴンを作成 */
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
96 void
397
a4f690f44842 delete manager (in kernel/ppe/TaskManager.h)
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 396
diff changeset
97 SceneGraphRoot::createFromXMLfile(TaskManager *manager, const char *xmlfile)
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
98 {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
99 xmlDocPtr doc;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
100 xmlNodePtr cur;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
101 SceneGraphPtr tmp;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
102
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
103 /* パース DOM生成 */
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
104 doc = xmlParseFile(xmlfile);
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
105 cur = xmlDocGetRootElement(doc);
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
106
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
107 /* ?? */
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
108 xmlStrcmp(cur->name,(xmlChar*)"OBJECT-3D");
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
109
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
110 /* XMLのノードを一つずつ解析 */
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
111 for (cur=cur->children; cur; cur=cur->next) {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
112 /* 扱うのはsurfaceオンリー */
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
113 if (xmlStrcmp(cur->name,(xmlChar*)"surface") != 0) {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
114 continue;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
115 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
116
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
117 /* ポリゴン(SceneGraph)生成 */
397
a4f690f44842 delete manager (in kernel/ppe/TaskManager.h)
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 396
diff changeset
118 tmp = new SceneGraph(manager, cur);
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
119
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
120 registSceneGraph(tmp);
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
121 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
122
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
123 xmlFreeDoc(doc);
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
124 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
125
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
126 SceneGraphPtr
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
127 SceneGraphRoot::createSceneGraph(int id)
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
128 {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
129 SceneGraphPtr src;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
130 SceneGraphPtr p;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
131
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
132 if (id < 0 || id > SGLIST_LENGTH) {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
133 return NULL;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
134 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
135
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
136 /* オリジナルの SceneGraph */
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
137 src = sg_src[id];
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
138
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
139 /* ユーザーにはオリジナルの clone を返す */
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
140 p = src->clone();
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
141
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
142 addNext(p);
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
143
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
144 return p;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
145 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
146
203
5c6c9667ac61 fix CreateSpan::run
gongo@localhost.localdomain
parents: 202
diff changeset
147 /**
5c6c9667ac61 fix CreateSpan::run
gongo@localhost.localdomain
parents: 202
diff changeset
148 * 何も表示しない、move,collision もしない SceneGraph を生成
5c6c9667ac61 fix CreateSpan::run
gongo@localhost.localdomain
parents: 202
diff changeset
149 * いずれ、Transform3D 的なものに回す予定
5c6c9667ac61 fix CreateSpan::run
gongo@localhost.localdomain
parents: 202
diff changeset
150 */
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
151 SceneGraphPtr
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
152 SceneGraphRoot::createSceneGraph(void)
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
153 {
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
154 SceneGraphPtr p = new SceneGraph;
215
7ca6a2ef5be9 fix SceneGraph Constructor, Destructor
gongo@gendarme.local
parents: 213
diff changeset
155
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
156 addNext(p);
203
5c6c9667ac61 fix CreateSpan::run
gongo@localhost.localdomain
parents: 202
diff changeset
157 p->flag_drawable = 0;
215
7ca6a2ef5be9 fix SceneGraph Constructor, Destructor
gongo@gendarme.local
parents: 213
diff changeset
158
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
159 return p;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
160 }
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
161
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
162 void
396
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
163 SceneGraphRoot::speExecute(int screen_w, int screen_h)
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
164 {
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
165
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
166 SceneGraphPtr list = sg_available_list;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
167 SceneGraphPtr t = sg_exec_tree;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
168 SceneGraphPtr cur_parent = camera;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
169
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
170 // 前フレームで描画した SceneGraph は削除
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
171 allRemove(sg_remove_list);
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
172
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
173 // 前フレームに作られた SceneGraph は描画用に移行
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
174 // 現フレームでの操作は以下の tree,list には適用されない
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
175 sg_draw_tree = sg_exec_tree;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
176 sg_remove_list = sg_available_list;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
177
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
178 // 現フレームで新しく SceneGraph がコピーされるので初期化
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
179 sg_exec_tree = NULL;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
180 sg_available_list = NULL;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
181
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
182 camera->move_execute(screen_w, screen_h);
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
183 camera->update(screen_w, screen_h);
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
184
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
185 camera->children = NULL;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
186 camera->lastChild = NULL;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
187
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
188 list->move_execute(screen_w, screen_h);
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
189 list->collision_check(screen_w, screen_h, list);
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
190
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
191 list->frame++;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
192 list = list->next;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
193
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
194 if(sg_exec_tree != NULL) {
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
195 return;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
196 }
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
197
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
198 /*removeのflagをもとにtreeを形成*/
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
199 while (t) {
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
200 SceneGraphPtr c = NULL;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
201 if (!t->isRemoved()) {
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
202 c = t->clone();
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
203 addNext(c);
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
204 cur_parent->addChild(c);
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
205 c->frame = t->frame;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
206 /*親の回転、座標から、子の回転、座標を算出*/
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
207 get_matrix(c->matrix, c->angle, c->xyz, cur_parent->matrix);
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
208 }
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
209
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
210 if (t->children != NULL && c != NULL) {
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
211 cur_parent = c;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
212 t = t->children;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
213 } else if (t->brother != NULL) {
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
214 t = t->brother;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
215 } else {
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
216 while (t) {
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
217 if (t->brother != NULL) {
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
218 t = t->brother;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
219 break;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
220 } else {
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
221 if (t->parent == NULL) {
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
222 t = NULL;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
223 break;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
224 } else {
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
225 cur_parent = cur_parent->parent;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
226 t = t->parent;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
227
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
228 }
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
229 }
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
230 }
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
231 }
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
232 }
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
233
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
234
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
235
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
236 // 現在、allExecute が終わった時点では
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
237 // camera->children が User SceneGraph の root になる
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
238
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
239 /**
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
240 * NULL じゃなかったら、setSceneData が呼ばれてるから
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
241 * そっちを次の Scene にする
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
242 */
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
243
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
244 sg_exec_tree = camera->children;
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
245 }
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
246
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
247
d1f1e27d0a12 don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
248 void
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
249 SceneGraphRoot::allExecute(int screen_w, int screen_h)
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
250 {
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
251 SceneGraphPtr list = sg_available_list;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
252 SceneGraphPtr t = sg_exec_tree;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
253 SceneGraphPtr cur_parent = camera;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
254
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
255 // 前フレームで描画した SceneGraph は削除
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
256 allRemove(sg_remove_list);
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
257
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
258 // 前フレームに作られた SceneGraph は描画用に移行
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
259 // 現フレームでの操作は以下の tree,list には適用されない
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
260 sg_draw_tree = sg_exec_tree;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
261 sg_remove_list = sg_available_list;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
262
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
263 // 現フレームで新しく SceneGraph がコピーされるので初期化
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
264 sg_exec_tree = NULL;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
265 sg_available_list = NULL;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
266
221
d61fded0729e Cameraの設定、Makefile 修正
gongo@gendarme.local
parents: 219
diff changeset
267 camera->move_execute(screen_w, screen_h);
206
dee3b5092a70 add Camera
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 203
diff changeset
268 camera->update(screen_w, screen_h);
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
269
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
270 camera->children = NULL;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
271 camera->lastChild = NULL;
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
272
339
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
273 /*まずは全部動作させる*/
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
274 while (list) {
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
275
339
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
276 list->move_execute(screen_w, screen_h);
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
277 list->collision_check(screen_w, screen_h, list);
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
278
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
279 list->frame++;
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
280 list = list->next;
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
281
339
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
282 }
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
283
339
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
284 if(sg_exec_tree != NULL) {
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
285 return;
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
286 }
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
287
339
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
288 /*removeのflagをもとにtreeを形成*/
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
289 while (t) {
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
290 SceneGraphPtr c = NULL;
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
291 if (!t->isRemoved()) {
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
292 c = t->clone();
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
293 addNext(c);
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
294 cur_parent->addChild(c);
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
295 c->frame = t->frame;
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
296 /*親の回転、座標から、子の回転、座標を算出*/
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
297 get_matrix(c->matrix, c->angle, c->xyz, cur_parent->matrix);
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
298 }
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
299
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
300 if (t->children != NULL && c != NULL) {
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
301 cur_parent = c;
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
302 t = t->children;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
303 } else if (t->brother != NULL) {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
304 t = t->brother;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
305 } else {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
306 while (t) {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
307 if (t->brother != NULL) {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
308 t = t->brother;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
309 break;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
310 } else {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
311 if (t->parent == NULL) {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
312 t = NULL;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
313 break;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
314 } else {
339
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
315 cur_parent = cur_parent->parent;
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
316 t = t->parent;
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
317
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
318 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
319 }
339
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
320 }
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
321 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
322 }
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
323
339
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
324
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
325
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
326 // 現在、allExecute が終わった時点では
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
327 // camera->children が User SceneGraph の root になる
339
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
328
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
329 /**
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
330 * NULL じゃなかったら、setSceneData が呼ばれてるから
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
331 * そっちを次の Scene にする
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
332 */
be8f785a82e9 change api setSceneDate
e065725@yutaka.st.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
333
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
334 sg_exec_tree = camera->children;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
335 }
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
336
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
337 void
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
338 SceneGraphRoot::allRemove(SceneGraphPtr list)
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
339 {
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
340 SceneGraphPtr p = list;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
341
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
342 while (p) {
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
343 SceneGraphPtr p1 = p->next;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
344 delete p;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
345 p = p1;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
346 cnt--;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
347 }
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
348 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
349
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
350 void
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
351 SceneGraphRoot::checkRemove(void)
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
352 {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
353 SceneGraphPtr p = sg_available_list;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
354 SceneGraphPtr p1;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
355
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
356 while (p) {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
357 p1 = p->next;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
358 if (p->isRemoved()) {
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
359 sg_exec_tree = p->realRemoveFromTree(sg_exec_tree);
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 196
diff changeset
360 sg_available_list = p->realRemoveFromList(sg_available_list);
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
361 }
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
362 delete p;
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
363 p = p1;
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
364 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
365 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
366
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
367 SceneGraphPtr
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
368 SceneGraphRoot::getExecuteSceneGraph(void)
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
369 {
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
370 return sg_exec_tree;
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
371 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
372
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
373 SceneGraphPtr
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
374 SceneGraphRoot::getDrawSceneGraph(void)
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
375 {
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
376 return sg_draw_tree;
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
377 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
378
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
379 void
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
380 SceneGraphRoot::updateControllerState(void)
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
381 {
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
382 controller->check();
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
383 }
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
384
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
385 void
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
386 SceneGraphRoot::setSceneData(SceneGraphPtr sg)
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
387 {
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
388 sg_exec_tree = sg;
196
932a05a7a1db add SceneGraphRoot, tools/create_sglist.pl
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
389 }
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 196
diff changeset
390
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 196
diff changeset
391 Pad*
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 196
diff changeset
392 SceneGraphRoot::getController(void)
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 196
diff changeset
393 {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 196
diff changeset
394 return controller;
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 196
diff changeset
395 }
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
396
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
397 SceneGraphIteratorPtr
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
398 SceneGraphRoot::getIterator(void)
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
399 {
222
gongo@localhost.localdomain
parents: 221
diff changeset
400 iterator->set(sg_remove_list);
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
401 return iterator;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
402 }
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
403
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
404 SceneGraphIteratorPtr
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
405 SceneGraphRoot::getIterator(SceneGraphPtr list)
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
406 {
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
407 iterator->set(list);
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
408 return iterator;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
409 }
219
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
410
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
411 CameraPtr
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
412 SceneGraphRoot::getCamera(void)
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
413 {
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
414 return camera;
0f1ff7b06157 allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 215
diff changeset
415 }