Mercurial > hg > Members > kono > Cerium
annotate Renderer/Test/gaplant.cc @ 562:a5fda4e51498
name search
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 22 Oct 2009 22:22:31 +0900 |
parents | 1a2f015c42b2 |
children | 306c9a7717c3 |
rev | line source |
---|---|
507 | 1 #include "SceneGraphRoot.h" |
2 #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
|
3 #include "gaplant.h" |
507 | 4 #include "back_action.h" |
5 | |
557
ec72b601b71f
fix examlples (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
508
diff
changeset
|
6 MainLoopPtr |
560
1a2f015c42b2
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) |
507 | 8 { |
9 SceneGraphPtr back; | |
10 SceneGraphPtr gaplant; | |
560
1a2f015c42b2
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"); |
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/Ball.xml"); |
507 | 13 |
14 back = sgroot->createSceneGraph(); | |
15 back->set_move_collision(back_move, back_coll); | |
16 gaplant = sgroot->createSceneGraph(); | |
17 gaplant->xyz[0] = 200; | |
18 gaplant->angle[0] = -60; | |
19 gaplant->angle[1] = 0; | |
20 gaplant->angle[2] = 0; | |
21 gaplant->set_move_collision(gaplant_move, gaplant_coll); | |
562 | 22 |
23 int foot = sgroot->getSgid("foot_L_A"); | |
24 for (int i = sgroot->getSgid("arm_L_D"); i <= foot; i++) { | |
507 | 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 */ |