refactor
This commit is contained in:
@@ -32,5 +32,12 @@ namespace RebootKit.Engine.Extensions {
|
||||
public static bool IsNonZero(this float3 vec, float epsilon = float.Epsilon) {
|
||||
return !vec.IsZero(epsilon);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool IsInRange(this float3 vec, float3 pos, float range) {
|
||||
float dstSquared = math.distancesq(vec, pos);
|
||||
float rangeSquared = range * range;
|
||||
return dstSquared <= rangeSquared;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user