Mercurial > hg > old > magoroku_racing.bad
changeset 138:a32551423d64
car matrix fix
author | Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 21 Jul 2011 22:14:50 +0900 |
parents | 5742d4f648cf |
children | 00d7de7fe9df |
files | car.cc car/car.dat gSprite.cc schedule.cc |
diffstat | 4 files changed, 15 insertions(+), 48 deletions(-) [+] |
line wrap: on
line diff
--- a/car.cc Thu Jul 21 18:54:45 2011 +0900 +++ b/car.cc Thu Jul 21 22:14:50 2011 +0900 @@ -335,6 +335,7 @@ ps2_vu0_unit_matrix(yrotinv); ps2_vu0_rot_matrix_y(yrotinv, yrotinv, degree2radian(car->y_angle)); + { FVECTOR yd = {0, -1, 0, 1}; FVECTOR rotaxis; @@ -352,6 +353,8 @@ quotanion_rotmatrix(pose, q); } + + ps2_vu0_mul_matrix(pose, yrot, pose); ps2_vu0_mul_matrix(pose, pose, yrotinv); ps2_vu0_copy_matrix(car->body->transfer, pose);
--- a/car/car.dat Thu Jul 21 18:54:45 2011 +0900 +++ b/car/car.dat Thu Jul 21 22:14:50 2011 +0900 @@ -1,8 +1,8 @@ n 1 -t car/asurada_gsx.xml car/a.png 0.02 2.01 2.0 0.04 +t car/asurada_gsx.xml car/a.png 0.20 20.10 2.0 0.40 n 2 -t car/kart_cp.xml car/a.png 0.01 3.01 1.8 0.03 +t car/kart_cp.xml car/a.png 0.20 30.10 1.8 0.30 n 3 -t car/asurada.xml car/a.png 0.03 2.51 2.0 0.03 +t car/asurada.xml car/a.png 0.30 25.10 2.0 0.30 n 4 -t car/kuruma2.xml car/a.png 0.03 2.51 2.0 0.03 \ No newline at end of file +t car/kuruma2.xml car/a.png 0.30 25.10 2.0 0.30 \ No newline at end of file
--- a/gSprite.cc Thu Jul 21 18:54:45 2011 +0900 +++ b/gSprite.cc Thu Jul 21 22:14:50 2011 +0900 @@ -130,7 +130,7 @@ { // window_posの略 //FVECTOR wp = {310,150, -800, 1}; - FVECTOR wp = {310 ,400 , 500, 1}; + FVECTOR wp = {310 ,400 , 300, 1}; for( int i = 0; i < 4; i ++ ){ root->xyz[i] = cameraMan_pos[i] + wp[i]; @@ -229,22 +229,6 @@ float scale[] = {my_scale,my_scale,1}; - if(test == 1){ - SceneGraphPtr wheel1 = droot->createSceneGraph("Cylinder.006"); - for( int i = 0; i < 3; i ++ ){ - wheel1->xyz[i] = object->xyz[i]; - } - root->addChild(wheel1); - //object->addChild(wheel1); - - /*親の回転、座標から、子の回転、座標を算出*/ - get_matrix_scale(wheel1->matrix, wheel1->angle, wheel1->xyz, scale, root->matrix); - - /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/ - get_matrix(wheel1->real_matrix, wheel1->angle, wheel1->xyz, root->real_matrix); - } - - // float scale[] = {my_scale,my_scale,1}; //float c_xyz[] = {0,0,0}; @@ -291,7 +275,7 @@ -// 制作途中 + //void gSprite_PutObjet(bool ScreenPos, OBJECT *obj) void gSprite_PutObject( int number, OBJECT *obj ) { @@ -309,7 +293,6 @@ sgObj->angle[i] = obj->angle[i]; } - memcpy( sgObj->matrix, obj->transfer, sizeof(FMATRIX) ); root->addChild(sgObj); @@ -320,15 +303,15 @@ SceneGraphPtr part = droot->createSceneGraph(obj->partName[i]); - for( int i = 0; i < 3; i ++ ){ + for( int i = 0; i < 4; i ++ ){ part->xyz[i] = sgObj->xyz[i]; part->angle[i] = sgObj->angle[i]; } // addChildの意味? - //root->addChild(part); + sgObj->addChild(part); //root->addChild(part); - //sgObj->addChild(part); + // 親の回転、座標から、子の回転、座標を算出 get_matrix_scale(part->matrix, part->angle, part->xyz, scale, root->matrix);
--- a/schedule.cc Thu Jul 21 18:54:45 2011 +0900 +++ b/schedule.cc Thu Jul 21 22:14:50 2011 +0900 @@ -425,8 +425,8 @@ /* スピードメーター */ //gSprite_DefSprite(SP_METER, 1, 1,(int)(106.0*(game->jiki->speed/game->jiki->speed_max)), 34); - // とりあえずコンパイル通すためにコメント。あとで調べましょう - // gSprite_DefSprite(SP_METER, "name", (float)(106.0*(game->jiki->speed/game->jiki->speed_max)), 34.0, 100); + //とりあえずコンパイル通すためにコメント。あとで調べましょう + //gSprite_DefSprite(SP_METER, "name", (float)(106.0*(game->jiki->speed/game->jiki->speed_max)), 34.0, 100); gSprite_PutSprite(true,SP_METER, 400, 400, TEST_Z_GRID, 0); @@ -444,24 +444,6 @@ gFont_SetStringInt((int)(100.0*game->jiki->speed), 380, 350); - // テスト用 - /* - if( pad.up > 0 ){ - game->jiki->direction[2] ++; - } - if( pad.down > 0 ){ - game->jiki->direction[2] --; - } - if( pad.right > 0 ){ - game->jiki->direction[1] ++; - } - if( pad.left > 0 ){ - game->jiki->direction[1] --; - } - */ - - - if ((pad.right > 0) && ((game->jiki->speed != 0) || (pad.circle > 0))) { car_swerve(game->jiki, 1); @@ -473,7 +455,6 @@ // 丸ボタン押したら加速 if (pad.circle > 0) { car_accelerate(game->jiki, 1); - //game->jiki->body->xyz[0] ++; //テスト用でし } // バツボタン押したら減速 if (pad.cross > 0) { @@ -515,7 +496,7 @@ gFont_SetString("Pause ...", 200, 200); } - + if (pad.circle == 1) { if (select == 0) { set_schedule_assumption(sche_game_main);