You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
using System; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
|
|
namespace UnityTest |
|
{ |
|
public class Vector4Comparer : VectorComparerBase<Vector4> |
|
{ |
|
public enum CompareType |
|
{ |
|
MagnitudeEquals, |
|
MagnitudeNotEquals |
|
} |
|
|
|
public CompareType compareType; |
|
public double floatingPointError; |
|
|
|
protected override bool Compare(Vector4 a, Vector4 b) |
|
{ |
|
switch (compareType) |
|
{ |
|
case CompareType.MagnitudeEquals: |
|
return AreVectorMagnitudeEqual(a.magnitude, |
|
b.magnitude, |
|
floatingPointError); |
|
case CompareType.MagnitudeNotEquals: |
|
return !AreVectorMagnitudeEqual(a.magnitude, |
|
b.magnitude, |
|
floatingPointError); |
|
} |
|
throw new Exception(); |
|
} |
|
public override int GetDepthOfSearch() |
|
{ |
|
return 3; |
|
} |
|
} |
|
}
|
|
|