• 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

Revisão352 (tree)
Hora2023-02-18 19:56:06
Autorxops-mikan

Mensagem de Log

AI移動時のジャンプ処理を改善

Mudança Sumário

Diff

--- trunk/ai.cpp (revision 351)
+++ trunk/ai.cpp (revision 352)
@@ -504,16 +504,35 @@
504504 bool AIcontrol::MoveJump()
505505 {
506506 //立ち止まっていれば処理しない
507+ // ※AIObjectDriver(ObjDriver)の移動フラグでチェックしても良い。
507508 if( ctrlhuman->GetMovemode(false) == 0 ){ return false; }
508509
509510 float dist_dummy;
510511
512+ float check_rx = 0.0f;
511513 float new_posx, new_posy, new_posz;
512514
515+ //進行方向を算出
516+ if( ObjDriver->GetModeFlag(AI_CTRL_MOVEWALK) == true ){
517+ check_rx = DegreeToRadian(0.0f);
518+ }
519+ if( ObjDriver->GetModeFlag(AI_CTRL_MOVEFORWARD) == true ){
520+ check_rx = DegreeToRadian(0.0f);
521+ }
522+ if( ObjDriver->GetModeFlag(AI_CTRL_MOVEBACKWARD) == true ){
523+ check_rx = DegreeToRadian(180.0f);
524+ }
525+ if( ObjDriver->GetModeFlag(AI_CTRL_MOVELEFT) == true ){
526+ check_rx = DegreeToRadian(90.0f);
527+ }
528+ if( ObjDriver->GetModeFlag(AI_CTRL_MOVERIGHT) == true ){
529+ check_rx = DegreeToRadian(-90.0f);
530+ }
531+
513532 //腰付近の当たり判定
514- new_posx = posx + cosf(rx*-1 + (float)M_PI/2) * (AI_CHECKJUMP_DIST + HUMAN_MAPCOLLISION_R);
533+ new_posx = posx + cosf(rx*-1 + (float)M_PI/2 + check_rx) * (AI_CHECKJUMP_DIST + HUMAN_MAPCOLLISION_R);
515534 new_posy = posy + HUMAN_MAPCOLLISION_HEIGHT;
516- new_posz = posz + sinf(rx*-1 + (float)M_PI/2) * (AI_CHECKJUMP_DIST + HUMAN_MAPCOLLISION_R);
535+ new_posz = posz + sinf(rx*-1 + (float)M_PI/2 + check_rx) * (AI_CHECKJUMP_DIST + HUMAN_MAPCOLLISION_R);
517536 if( CollD->CheckALLBlockInside(new_posx, new_posy, new_posz) == true ){
518537 ObjMgr->MoveJump(ctrlid);
519538 return true;
@@ -520,9 +539,9 @@
520539 }
521540
522541 //体全体の当たり判定
523- new_posx = posx + cosf(rx*-1 + (float)M_PI/2) * AI_CHECKJUMP_DIST;
542+ new_posx = posx + cosf(rx*-1 + (float)M_PI/2 + check_rx) * AI_CHECKJUMP_DIST;
524543 new_posy = posy + AI_CHECKJUMP_HEIGHT;
525- new_posz = posz + sinf(rx*-1 + (float)M_PI/2) * AI_CHECKJUMP_DIST;
544+ new_posz = posz + sinf(rx*-1 + (float)M_PI/2 + check_rx) * AI_CHECKJUMP_DIST;
526545 if( CollD->CheckALLBlockInside(new_posx, new_posy, new_posz) == true ){
527546 ObjMgr->MoveJump(ctrlid);
528547 return true;