comparison car.cc @ 146:d1ddd095ab03

draw dot hit cource -rainbow-
author e085768
date Fri, 29 Jul 2011 15:18:48 +0900
parents 993d5f7e5f30
children c920a164d68a
comparison
equal deleted inserted replaced
143:be127b7d1812 146:d1ddd095ab03
224 FieldPtr p; 224 FieldPtr p;
225 FieldPtr f = field_get_actual(); 225 FieldPtr f = field_get_actual();
226 226
227 // 現在のコースで衝突・内外判定 227 // 現在のコースで衝突・内外判定
228 p = f; 228 p = f;
229
229 if (col_detect(&p->colface, car->vertical, car->location) == true) { 230 if (col_detect(&p->colface, car->vertical, car->location) == true) {
230 goto FIELD_CHECK_OK; 231 goto FIELD_CHECK_OK;
231 } 232 }
232 233
233 // 現在のコースの次に隣接するコースで衝突・内外判定 234 // 現在のコースの次に隣接するコースで衝突・内外判定
302 // 車の現在地 = 車の位置 + 移動量 って事だと思う多分 303 // 車の現在地 = 車の位置 + 移動量 って事だと思う多分
303 ps2_vu0_add_vector(car->location, car->location, mov); 304 ps2_vu0_add_vector(car->location, car->location, mov);
304 305
305 306
306 //思う方向と逆に動いたので、マイナスして見ている。 307 //思う方向と逆に動いたので、マイナスして見ている。
307 car->body->xyz[0] = -car->location[0]; 308 /*
308 car->body->xyz[1] = -car->location[1]; 309 car->body->xyz[0] = -car->location[0];
309 car->body->xyz[2] = -car->location[2]; 310 car->body->xyz[1] = -car->location[1];
311 car->body->xyz[2] = -car->location[2];
312 */
313
314 car->body->xyz[0] = car->location[0];
315 car->body->xyz[1] = car->location[1];
316 car->body->xyz[2] = car->location[2];
317
310 318
311 // 壁にぶつかった時の処理 319 // 壁にぶつかった時の処理
312 if (car_field_check(game,car) == false) { 320 if (car_field_check(game,car) == false) {
313 // 壁にぶつかったら計算前の前フレームの座標にしてsppedは半分 321 // 壁にぶつかったら計算前の前フレームの座標にしてsppedは半分
314 ps2_vu0_copy_vector(car->location, prev_location); 322 ps2_vu0_copy_vector(car->location, prev_location);
369 car->speed -= 0.005; 377 car->speed -= 0.005;
370 car->speed = (car->speed < 0) ? 0 : car->speed; 378 car->speed = (car->speed < 0) ? 0 : car->speed;
371 379
372 // 角度。なぜかマイナス2倍でウマくいってる 380 // 角度。なぜかマイナス2倍でウマくいってる
373 car->body->angle[1] = -car->y_angle * 2; 381 car->body->angle[1] = -car->y_angle * 2;
374 car->body->angle[0] = -90.0f; 382 // car->body->angle[0] = -90.0f;
375 383
376 // 傾き 384 // 傾き
377 car_axis_rotation(car); 385 car_axis_rotation(car);
378 } 386 }
379 387