Mercurial > hg > Game > Cerium
annotate Renderer/Test/gaplant.cc @ 1144:e068c1269292 draft
light fix
author | Yutaka_Kinjyo |
---|---|
date | Sat, 19 Feb 2011 03:54:12 +0900 |
parents | 801d57ae1e29 |
children |
rev | line source |
---|---|
539 | 1 #include "SceneGraphRoot.h" |
2 #include "gaplant_action.h" | |
560
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
3 #include "gaplant.h" |
539 | 4 #include "back_action.h" |
5 | |
557
764772be1e3c
fix examlples (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
540
diff
changeset
|
6 MainLoopPtr |
560
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
7 gaplant::init(Viewer *sgroot, int w, int h) |
539 | 8 { |
9 SceneGraphPtr back; | |
10 SceneGraphPtr gaplant; | |
560
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
11 sgroot->createFromXMLfile("xml_file/gap_plane_test.xml"); |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
12 sgroot->createFromXMLfile("xml_file/Ball.xml"); |
539 | 13 |
1144 | 14 sgroot->OnLightSysSwitch(); |
1142
801d57ae1e29
cut compile CreatePolygonTask on spe side because not enough spe memory. We have to use code loading.
yutaka@localhost.localdomain
parents:
729
diff
changeset
|
15 |
539 | 16 back = sgroot->createSceneGraph(); |
17 back->set_move_collision(back_move, back_coll); | |
18 gaplant = sgroot->createSceneGraph(); | |
628 | 19 gaplant->xyz[0] = w / 2; |
20 gaplant->xyz[1] = h / 2; | |
21 | |
539 | 22 gaplant->angle[0] = -60; |
23 gaplant->angle[1] = 0; | |
24 gaplant->angle[2] = 0; | |
25 gaplant->set_move_collision(gaplant_move, gaplant_coll); | |
562 | 26 |
628 | 27 int foot = sgroot->getSgid("chest_center_B"); |
28 for (int i = sgroot->getSgid("chest_center_B.074"); i <= foot; i++) { | |
539 | 29 SceneGraphPtr p = sgroot->createSceneGraph(i); |
30 gaplant->addChild(p); | |
31 } | |
32 | |
33 back->addChild(gaplant); | |
34 sgroot->setSceneData(back); | |
557
764772be1e3c
fix examlples (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
540
diff
changeset
|
35 return sgroot; |
539 | 36 } |
560
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
37 |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
38 extern Application * |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
39 application() { |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
40 return new gaplant(); |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
41 } |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
42 |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
43 const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n"; |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
44 |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
45 extern int init(TaskManager *manager, int argc, char *argv[]); |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
46 extern void task_initialize(); |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
47 static void TMend(TaskManager *manager); |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
48 |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
49 int |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
50 TMmain(TaskManager *manager, int argc, char *argv[]) |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
51 { |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
52 task_initialize(); |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
53 manager->set_TMend(TMend); |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
54 return init(manager, argc, argv); |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
55 |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
56 } |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
57 |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
58 void |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
59 TMend(TaskManager *manager) |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
60 { |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
61 printf("test_nogl end\n"); |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
62 } |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
63 |
f28217567cbe
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
64 /* end */ |