• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。


Commit MetaInfo

Revision165 (tree)
Time2017-03-07 23:21:56
Authorxops-mikan

Log Message

人とマップの斜面に対する当たり判定を改善、デバック情報表示の項目を追加。

Change Summary

Incremental Difference

--- trunk/gamemain.cpp (revision 164)
+++ trunk/gamemain.cpp (revision 165)
@@ -2152,6 +2152,9 @@
21522152
21532153 //デバック用・ゲーム情報の表示
21542154 if( (ShowInfo_Debugmode == true)||(Camera_Debugmode == true) ){
2155+ float move_x, move_y, move_z;
2156+ myHuman->GetMovePos(&move_x, &move_y, &move_z);
2157+
21552158 //テクスチャフォントによる表示(半角英数字と記号のみ)
21562159 sprintf(str, "frame:%d time %02d:%02d", framecnt, framecnt/(int)GAMEFPS/60, framecnt/(int)GAMEFPS%60);
21572160 d3dg->Draw2DTextureDebugFontText(10+1, 10+1, str, d3dg->GetColorCode(0.1f,0.1f,0.1f,1.0f));
@@ -2159,12 +2162,15 @@
21592162 sprintf(str, "camera x:%.2f y:%.2f z:%.2f rx:%.2f ry:%.2f", camera_x, camera_y, camera_z, camera_rx, camera_ry);
21602163 d3dg->Draw2DTextureDebugFontText(10+1, 30+1, str, d3dg->GetColorCode(0.1f,0.1f,0.1f,1.0f));
21612164 d3dg->Draw2DTextureDebugFontText(10, 30, str, d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f));
2162- sprintf(str, "human[%d] x:%.2f y:%.2f z:%.2f rx:%.2f HP:%d", ObjMgr.GetPlayerID(), human_x, human_y, human_z, human_rx, hp);
2165+ sprintf(str, "human[%02d] x:%.2f y:%.2f z:%.2f rx:%.2f HP:%d", ObjMgr.GetPlayerID(), human_x, human_y, human_z, human_rx, hp);
21632166 d3dg->Draw2DTextureDebugFontText(10+1, 50+1, str, d3dg->GetColorCode(0.1f,0.1f,0.1f,1.0f));
21642167 d3dg->Draw2DTextureDebugFontText(10, 50, str, d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f));
2165- sprintf(str, "Input:%02dms Object:%02dms AI:%02dms Event:%02dms Sound:%02dms Render:%02dms", time_input, time_process_object, time_process_ai, time_process_event, time_sound, time_render);
2168+ sprintf(str, " move_x:%.2f move_y:%.2f move_z:%.2f", move_x, move_y, move_z);
21662169 d3dg->Draw2DTextureDebugFontText(10+1, 70+1, str, d3dg->GetColorCode(0.1f,0.1f,0.1f,1.0f));
21672170 d3dg->Draw2DTextureDebugFontText(10, 70, str, d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f));
2171+ sprintf(str, "Input:%02dms Object:%02dms AI:%02dms Event:%02dms Sound:%02dms Render:%02dms", time_input, time_process_object, time_process_ai, time_process_event, time_sound, time_render);
2172+ d3dg->Draw2DTextureDebugFontText(10+1, 90+1, str, d3dg->GetColorCode(0.1f,0.1f,0.1f,1.0f));
2173+ d3dg->Draw2DTextureDebugFontText(10, 90, str, d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f));
21682174 }
21692175
21702176 //ゲーム実行速度の表示
--- trunk/object.cpp (revision 164)
+++ trunk/object.cpp (revision 165)
@@ -1460,8 +1460,9 @@
14601460
14611461 struct blockdata bdata;
14621462 inblockdata->Getdata(&bdata, id);
1463+ float surface_ang = acos(bdata.material[face].vy);
14631464
1464- if( acos(bdata.material[face].vy) > HUMAN_MAPCOLLISION_SLOPEANGLE ){ //斜面〜壁なら
1465+ if( surface_ang > DegreeToRadian((90.0f-1.0f)) ){ //壁なら
14651466 //乗り越えられる高さか調べる
14661467 if( CollD->CheckALLBlockIntersectDummyRay(pos_x, pos_y + 3.5f + offset, pos_z, vx, 0, vz, NULL, NULL, &Dist, speed) == false ){
14671468 //人を上に持ち上げる
@@ -1472,7 +1473,11 @@
14721473 //足元を当たり判定
14731474 CollD->ScratchVector(id, face, move_x2, vy, move_z2, &move_x2, &vy, &move_z2);
14741475 }
1475- else{ //水平〜斜面なら
1476+ else if( surface_ang > HUMAN_MAPCOLLISION_SLOPEANGLE ){ //斜面〜壁なら
1477+ //足元を当たり判定
1478+ CollD->ScratchVector(id, face, move_x2, vy, move_z2, &move_x2, &vy, &move_z2);
1479+ }
1480+ else{ //水平〜斜面なら
14761481 //地面と認めない (ジャンプ対策)
14771482 move_y_flag = true;
14781483
@@ -1487,16 +1492,16 @@
14871492 float height = HUMAN_HEIGHT - Dist;
14881493
14891494 //人を上に持ち上げる
1490- if( height > 0.9f ){
1491- FallDistance = 0.4f;
1495+ FallDistance = height;
1496+
1497+ if( height > 0.4f ){
1498+ move_x2 *= 0.75f;
1499+ move_z2 *= 0.75f;
1500+ move_x = move_x2;
1501+ move_z = move_z2;
14921502 }
1493- else{
1494- FallDistance = height;
1495- }
14961503
1497- //move_x2 = 0.0f;
14981504 move_y = 0.0f;
1499- //move_z2 = 0.0f;
15001505 }
15011506 }
15021507 }
@@ -1581,7 +1586,7 @@
15811586 MapCollisionDetection(CollD, inblockdata, AddCollisionFlag, &FallDistance, &nowmove_x, &nowmove_z);
15821587
15831588 //移動するなら
1584- if( (nowmove_x*nowmove_x + nowmove_z*nowmove_z) > 0.0f * 0.0f ){
1589+ if( (nowmove_x*nowmove_x + nowmove_z*nowmove_z) > 0.0f ){
15851590 totalmove += sqrt(nowmove_x*nowmove_x + nowmove_z*nowmove_z);
15861591 }
15871592