More cleanups of custom classes in favor of .NET runtime types.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
using Framework.GameMath;
|
||||
using System.Numerics;
|
||||
|
||||
namespace Game.Collision
|
||||
{
|
||||
@@ -64,7 +65,7 @@ namespace Game.Collision
|
||||
public bool GetObjectHitPos(Vector3 startPos, Vector3 endPos, ref Vector3 resultHitPos, float modifyDist, PhaseShift phaseShift)
|
||||
{
|
||||
bool result;
|
||||
float maxDist = (endPos - startPos).magnitude();
|
||||
float maxDist = (endPos - startPos).Length();
|
||||
// valid map coords should *never ever* produce float overflow, but this would produce NaNs too
|
||||
Cypher.Assert(maxDist < float.MaxValue);
|
||||
// prevent NaN values which can cause BIH intersection to enter infinite loop
|
||||
@@ -81,7 +82,7 @@ namespace Game.Collision
|
||||
resultHitPos = startPos + dir * dist;
|
||||
if (modifyDist < 0)
|
||||
{
|
||||
if ((resultHitPos - startPos).magnitude() > -modifyDist)
|
||||
if ((resultHitPos - startPos).Length() > -modifyDist)
|
||||
resultHitPos += dir * modifyDist;
|
||||
else
|
||||
resultHitPos = startPos;
|
||||
@@ -101,7 +102,7 @@ namespace Game.Collision
|
||||
|
||||
public bool IsInLineOfSight(Vector3 startPos, Vector3 endPos, PhaseShift phaseShift)
|
||||
{
|
||||
float maxDist = (endPos - startPos).magnitude();
|
||||
float maxDist = (endPos - startPos).Length();
|
||||
|
||||
if (!MathFunctions.fuzzyGt(maxDist, 0))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user