Mercurial > hg > Members > kono > Cerium
annotate Renderer/Test/gaplant.cc @ 560:1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 22 Oct 2009 19:23:13 +0900 |
parents | ec72b601b71f |
children | a5fda4e51498 |
rev | line source |
---|---|
507 | 1 #include "SceneGraphRoot.h" |
560
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
2 #include "xml_file/gap_plane_test.xml.h" |
507 | 3 #include "gaplant_action.h" |
560
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
4 #include "gaplant.h" |
507 | 5 #include "back_action.h" |
6 | |
557
ec72b601b71f
fix examlples (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
508
diff
changeset
|
7 MainLoopPtr |
560
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
8 gaplant::init(Viewer *sgroot, int w, int h) |
507 | 9 { |
10 SceneGraphPtr back; | |
11 SceneGraphPtr gaplant; | |
560
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
12 sgroot->createFromXMLfile("xml_file/gap_plane_test.xml"); |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
13 sgroot->createFromXMLfile("xml_file/Ball.xml"); |
507 | 14 |
15 back = sgroot->createSceneGraph(); | |
16 back->set_move_collision(back_move, back_coll); | |
17 gaplant = sgroot->createSceneGraph(); | |
18 gaplant->xyz[0] = 200; | |
19 gaplant->angle[0] = -60; | |
20 gaplant->angle[1] = 0; | |
21 gaplant->angle[2] = 0; | |
22 gaplant->set_move_collision(gaplant_move, gaplant_coll); | |
23 | |
24 for (int i = arm_L_D; i <= foot_L_A; i++) { | |
25 SceneGraphPtr p = sgroot->createSceneGraph(i); | |
26 gaplant->addChild(p); | |
27 } | |
28 | |
29 back->addChild(gaplant); | |
30 sgroot->setSceneData(back); | |
557
ec72b601b71f
fix examlples (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
508
diff
changeset
|
31 return sgroot; |
507 | 32 } |
560
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
33 |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
34 |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
35 |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
36 extern Application * |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
37 application() { |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
38 return new gaplant(); |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
39 } |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
40 |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
41 const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n"; |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
42 |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
43 extern int init(TaskManager *manager, int argc, char *argv[]); |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
44 extern void task_initialize(); |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
45 static void TMend(TaskManager *manager); |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
46 |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
47 int |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
48 TMmain(TaskManager *manager, int argc, char *argv[]) |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
49 { |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
50 task_initialize(); |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
51 manager->set_TMend(TMend); |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
52 return init(manager, argc, argv); |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
53 |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
54 } |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
55 |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
56 void |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
57 TMend(TaskManager *manager) |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
58 { |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
59 printf("test_nogl end\n"); |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
60 } |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
61 |
1a2f015c42b2
gaplant... how to solve scenegraph id conflict?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
557
diff
changeset
|
62 /* end */ |