瀏覽代碼

checkInFoV correction
requested:
https://github.com/GarageGames/Torque3D/issues/1009
crosscheck vs https://github.com/GarageGames/Torque3D/blob/69838bdc8c9bc055b9b1ae76f42b0f28d2a33909/Engine/source/T3D/fps/guiShapeNameHud.cpp#L177-L240 upon which that was based.

Azaezel 10 年之前
父節點
當前提交
8ac10e42b0
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Engine/source/T3D/aiPlayer.cpp

+ 1 - 1
Engine/source/T3D/aiPlayer.cpp

@@ -703,7 +703,7 @@ bool AIPlayer::checkInFoV(GameBase* target, F32 camFov, bool _checkEnabled)
    // projection and box test.
    // projection and box test.
    shapeDir.normalize();
    shapeDir.normalize();
    F32 dot = mDot(shapeDir, camDir);
    F32 dot = mDot(shapeDir, camDir);
-   return (dot > camFov);
+   return (dot > mCos(camFov));
 }
 }
 
 
 DefineEngineMethod(AIPlayer, checkInFoV, bool, (ShapeBase* obj, F32 fov, bool checkEnabled), (NULL, 45.0f, false),
 DefineEngineMethod(AIPlayer, checkInFoV, bool, (ShapeBase* obj, F32 fov, bool checkEnabled), (NULL, 45.0f, false),