Mercurial > hg > Members > kono > Cerium
comparison Renderer/Test/chain_old.cc @ 585:987380738a50
chain_old
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 26 Oct 2009 09:03:14 +0900 |
parents | ec72b601b71f |
children | f42b303044f7 |
comparison
equal
deleted
inserted
replaced
584:a13373114df4 | 585:987380738a50 |
---|---|
1 #include <iostream> | 1 #include <iostream> |
2 #include <math.h> | 2 #include <math.h> |
3 #include "SceneGraphRoot.h" | 3 #include "SceneGraphRoot.h" |
4 #include "SGList.h" | |
5 #include "SceneGraph.h" | 4 #include "SceneGraph.h" |
6 #include "TaskManager.h" | 5 #include "TaskManager.h" |
6 #include "Chain.h" | |
7 #include "Func.h" | 7 #include "Func.h" |
8 | 8 |
9 | 9 |
10 #define FALSE 0 | 10 #define FALSE 0 |
11 #define TRUE !FALSE | 11 #define TRUE !FALSE |
125 { | 125 { |
126 | 126 |
127 } | 127 } |
128 | 128 |
129 MainLoopPtr | 129 MainLoopPtr |
130 chain_old::init(Viewer *sgroot, int w, int h) | 130 Chain::init(Viewer *sgroot, int w, int h) |
131 { | 131 { |
132 SceneGraphPtr root_old_chain, chain; | 132 SceneGraphPtr root_old_chain, chain; |
133 CHAIN_VARS rcv; | 133 CHAIN_VARS rcv; |
134 | 134 |
135 sgroot->createFromXMLfile(manager,"xml_file/chain.xml"); | 135 sgroot->createFromXMLfile("xml_file/chain.xml"); |
136 | 136 |
137 root_old_chain = sgroot->createSceneGraph(CHAIN); | 137 root_old_chain = sgroot->createSceneGraph("CHAIN"); |
138 root_old_chain->set_move_collision(chain_old_move_ope, chain_old_collision); | 138 root_old_chain->set_move_collision(chain_old_move_ope, chain_old_collision); |
139 init_chainold_vars(&rcv); | 139 init_chainold_vars(&rcv); |
140 rcv.next_x = w / 2; | 140 rcv.next_x = w / 2; |
141 rcv.next_y = 0.0; | 141 rcv.next_y = 0.0; |
142 set_old_vector(&rcv, root_old_chain); | 142 set_old_vector(&rcv, root_old_chain); |
143 | 143 |
144 for(int i = 0; i < CHAIN_LEN; i++) { | 144 for(int i = 0; i < CHAIN_LEN; i++) { |
145 chain = sgroot->createSceneGraph(CHAIN); | 145 chain = sgroot->createSceneGraph("CHAIN"); |
146 chain->id = i; | 146 chain->id = i; |
147 init_chainold_vars(&cv[i]); | 147 init_chainold_vars(&cv[i]); |
148 cv[i].x = 0; | 148 cv[i].x = 0; |
149 cv[i].y = chain_width * i; | 149 cv[i].y = chain_width * i; |
150 set_old_vector(&cv[i], chain); | 150 set_old_vector(&cv[i], chain); |
159 return sgroot; | 159 return sgroot; |
160 } | 160 } |
161 | 161 |
162 extern Application * | 162 extern Application * |
163 application() { | 163 application() { |
164 return new ball_bound(); | 164 return new Chain(); |
165 } | 165 } |
166 | 166 |
167 const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n"; | 167 const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n"; |
168 | 168 |
169 extern int init(TaskManager *manager, int argc, char *argv[]); | 169 extern int init(TaskManager *manager, int argc, char *argv[]); |