From 066f6b3f34bf53168fd414704029d908d68ef297 Mon Sep 17 00:00:00 2001 From: ikpil Date: Wed, 12 Apr 2023 23:24:29 +0900 Subject: [PATCH] remove Vector3f.ToArray --- src/DotRecast.Core/RecastMath.cs | 26 -------------------------- src/DotRecast.Core/Vector3f.cs | 5 ----- 2 files changed, 31 deletions(-) diff --git a/src/DotRecast.Core/RecastMath.cs b/src/DotRecast.Core/RecastMath.cs index 2e222b5..d8b13dd 100644 --- a/src/DotRecast.Core/RecastMath.cs +++ b/src/DotRecast.Core/RecastMath.cs @@ -163,15 +163,6 @@ namespace DotRecast.Core return dest; } - public static float[] vSub(float[] v1, float[] v2) - { - Vector3f dest = new Vector3f(); - dest[0] = v1[0] - v2[0]; - dest[1] = v1[1] - v2[1]; - dest[2] = v1[2] - v2[2]; - return dest.ToArray(); - } - public static Vector3f vSub(Vector3f v1, Vector3f v2) { Vector3f dest = new Vector3f(); @@ -945,23 +936,6 @@ namespace DotRecast.Core return a[0] * b[2] - a[2] * b[0]; } - - public static Tuple? intersectSegSeg2D(float[] ap, float[] aq, float[] bp, float[] bq) - { - float[] u = vSub(aq, ap); - float[] v = vSub(bq, bp); - float[] w = vSub(ap, bp); - float d = vperpXZ(u, v); - if (Math.Abs(d) < 1e-6f) - { - return null; - } - - float s = vperpXZ(v, w) / d; - float t = vperpXZ(u, w) / d; - return Tuple.Create(s, t); - } - public static Tuple? intersectSegSeg2D(Vector3f ap, Vector3f aq, Vector3f bp, Vector3f bq) { Vector3f u = vSub(aq, ap); diff --git a/src/DotRecast.Core/Vector3f.cs b/src/DotRecast.Core/Vector3f.cs index 8e02a08..9aab844 100644 --- a/src/DotRecast.Core/Vector3f.cs +++ b/src/DotRecast.Core/Vector3f.cs @@ -88,11 +88,6 @@ namespace DotRecast.Core } } - public float[] ToArray() - { - return new float[] { x, y, z }; - } - public static bool operator ==(Vector3f left, Vector3f right) { return (left.x == right.x)