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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include "SceneGraphRoot.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
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
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #include "back_action.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
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
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 {
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 SceneGraphPtr back;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
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
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
1144
e068c1269292 light fix
Yutaka_Kinjyo
parents: 1142
diff changeset
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
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 back = sgroot->createSceneGraph();
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 back->set_move_collision(back_move, back_coll);
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 gaplant = sgroot->createSceneGraph();
628
f7e87789b1dd change gaplan.cc
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents: 562
diff changeset
19 gaplant->xyz[0] = w / 2;
f7e87789b1dd change gaplan.cc
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents: 562
diff changeset
20 gaplant->xyz[1] = h / 2;
f7e87789b1dd change gaplan.cc
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents: 562
diff changeset
21
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 gaplant->angle[0] = -60;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 gaplant->angle[1] = 0;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 gaplant->angle[2] = 0;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 gaplant->set_move_collision(gaplant_move, gaplant_coll);
562
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 560
diff changeset
26
628
f7e87789b1dd change gaplan.cc
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents: 562
diff changeset
27 int foot = sgroot->getSgid("chest_center_B");
f7e87789b1dd change gaplan.cc
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents: 562
diff changeset
28 for (int i = sgroot->getSgid("chest_center_B.074"); i <= foot; i++) {
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 SceneGraphPtr p = sgroot->createSceneGraph(i);
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 gaplant->addChild(p);
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 }
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 back->addChild(gaplant);
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
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
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
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 */