Mercurial > hg > Game > Cerium
annotate Renderer/Test/collada.cc @ 1392:555d2a31cf0c draft
collada moved
author | e095732 <e095732@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 30 Jan 2012 16:12:20 +0900 |
parents | 1ea6e4eb2b0a |
children | ad841dcdbe67 |
rev | line source |
---|---|
1281
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 #include <math.h> |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 #include <stdlib.h> |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 #include "SceneGraphRoot.h" |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 #include "MainLoop.h" |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 #include "ball_bound.h" |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 // prototype |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 static void ball_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 static void ball_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h, SceneGraphPtr tree); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 static void ball_collision_idle(SceneGraphPtr, void *sgroot_, int w, int h, SceneGraphPtr tree); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 static float vy = 0.0f; // y 方向速度 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 static float dt = 1.0/1.0f; // frame rate |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 static float e = -0.8f; // 反発係数 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 static float g = 9.8f; // 重力加速度 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 //static float v0 = 0.0f; // 初速は 0 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 static float h0; // 初期高さ |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 static float ball_radius = 100.0f; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 static float speed = 10.0f; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 static void |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 ball_move_idle2(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h) |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 { |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 Pad *pad = sgroot->getController(); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 if (pad->circle.isHold()) { |
1384 | 33 if (pad->left.isHold()) { |
34 node->xyz[0] -= speed; | |
35 if(node->xyz[0] < ball_radius) | |
36 node->xyz[0] = ball_radius; | |
37 } else if (pad->right.isHold()) { | |
38 node->xyz[0] += speed; | |
39 if(node->xyz[0] > screen_w - ball_radius) | |
40 node->xyz[0] = screen_w - ball_radius; | |
41 } | |
42 | |
43 if (pad->up.isHold()) { | |
44 node->xyz[1] -= speed; | |
45 } else if (pad->down.isHold()) { | |
46 node->xyz[1] += speed; | |
1281
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 if(node->xyz[1] > screen_h - ball_radius) |
1384 | 48 node->xyz[1] = screen_h - ball_radius; |
49 } | |
1281
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 } else { |
1384 | 51 node->set_move_collision(ball_move, ball_collision); |
1281
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 } |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
53 } |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 static int time_val = 0; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
56 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
57 static void |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
58 ball_move_idle(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h) |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
59 { |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
60 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
61 Pad *pad = sgroot->getController(); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
63 if (pad->circle.isPush()) { |
1384 | 64 node->set_move_collision(ball_move_idle2, ball_collision_idle); |
65 time_val = 0; | |
1281
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 } |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 time_val++; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 if (time_val > 90) { |
1384 | 71 float w = (float)random(); |
72 | |
73 w = fmodf(w, screen_w - ball_radius*2); | |
74 node->xyz[0] = w + ball_radius; | |
75 node->xyz[1] = h0; | |
76 node->set_move_collision(ball_move, ball_collision); | |
77 time_val = 0; | |
1281
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
78 } |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79 } |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 static void |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
82 ball_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h) |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83 { |
1384 | 84 vy += g * dt; |
85 node->xyz[1] += vy * dt; | |
1281
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 // node->xyz[0] += 10.0f; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 } |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 static void |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 ball_collision_idle(SceneGraphPtr, void *sgroot_, int w, int h, SceneGraphPtr tree) |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 { |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 } |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
93 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 static void |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 ball_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h, |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96 SceneGraphPtr tree) |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
97 { |
1384 | 98 if (node->xyz[1] > screen_h - ball_radius) { |
99 node->xyz[1] = screen_h - ball_radius; | |
100 | |
101 vy *= e; | |
102 if (vy > -g && vy < 0) { | |
103 vy = 0.0; | |
104 node->set_move_collision(ball_move_idle, ball_collision_idle); | |
105 } | |
106 } | |
1281
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
107 } |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
108 |
1392 | 109 static const char *collada_file="collada_file/sample.dae";//"collada_file/ball.dae"; |
110 static const char *name="Cube"; | |
1284
fe598e9b7f0e
improve collada file
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
1283
diff
changeset
|
111 |
1281
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112 MainLoopPtr |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 ball_bound::init(Viewer *sgroot, int screen_w, int screen_h) |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 { |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
115 SceneGraphPtr ball; |
1283 | 116 |
1281
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
117 // 固定した値で srandom すると、毎回同じ、random() 列が生成される |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
118 // random な値が欲しいなら、man random に方法が書いてあります。 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
119 srandom(100); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
120 |
1283 | 121 sgroot->createFromCOLLADAfile(collada_file); |
1281
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
122 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
123 //sgroot->OnLightSysSwitch(); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
124 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
125 SceneGraphPtr light = sgroot->getLight(0); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
126 sgroot->OnLightSwitch(0); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
127 light->xyz[0] = screen_w / 2; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
128 light->xyz[1] = screen_h / 2; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
129 light->xyz[2] = -100; |
1284
fe598e9b7f0e
improve collada file
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
1283
diff
changeset
|
130 ball = sgroot->createSceneGraph(name); |
1281
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
131 ball->set_move_collision(ball_move, ball_collision); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
132 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
133 h0 = screen_h/2; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
134 h0 = -1000; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
135 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
136 ball->xyz[0] = screen_w/2; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
137 //ball->xyz[0] = 0.0f; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
138 ball->xyz[1] = h0; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
139 ball->xyz[2] = 30.0f; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
140 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
141 sgroot->setSceneData(ball); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
142 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
143 return sgroot; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
144 } |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
145 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
146 extern Application * |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
147 application() { |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
148 return new ball_bound(); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
149 } |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
150 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
151 const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n"; |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
152 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
153 extern int init(TaskManager *manager, int argc, char *argv[]); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
154 extern void task_initialize(); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
155 static void TMend(TaskManager *manager); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
156 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
157 int |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
158 TMmain(TaskManager *manager, int argc, char *argv[]) |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
159 { |
1284
fe598e9b7f0e
improve collada file
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
1283
diff
changeset
|
160 for(int i=1; i<argc; i++){ |
fe598e9b7f0e
improve collada file
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
1283
diff
changeset
|
161 if (argv[i][0] == '-' && argv[i][1] == 's') { |
fe598e9b7f0e
improve collada file
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
1283
diff
changeset
|
162 i++; |
fe598e9b7f0e
improve collada file
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
1283
diff
changeset
|
163 collada_file=argv[i]; |
fe598e9b7f0e
improve collada file
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
1283
diff
changeset
|
164 } else if (argv[i][0] == '-' && argv[i][1] == 'n') { |
fe598e9b7f0e
improve collada file
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
1283
diff
changeset
|
165 i++; |
fe598e9b7f0e
improve collada file
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
1283
diff
changeset
|
166 name = argv[i]; |
fe598e9b7f0e
improve collada file
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
1283
diff
changeset
|
167 } |
fe598e9b7f0e
improve collada file
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
1283
diff
changeset
|
168 } |
1281
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
169 task_initialize(); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
170 manager->set_TMend(TMend); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
171 return init(manager, argc, argv); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
172 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
173 } |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
174 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
175 void |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
176 TMend(TaskManager *manager) |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
177 { |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
178 printf("test_nogl end\n"); |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
179 } |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
180 |
b91eb52582cc
copy ball_bound to collada
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
181 /* end */ |