More cleanups of custom classes in favor of .NET runtime types.

This commit is contained in:
hondacrx
2021-11-15 18:04:57 -05:00
parent a9a51d0641
commit b026ee7ef8
132 changed files with 373 additions and 6833 deletions
+4 -3
View File
@@ -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;