[0,1,2] -> xyz

This commit is contained in:
ikpil 2023-04-29 12:41:07 +09:00
parent 39bb7e32b4
commit 98e2504d7f
5 changed files with 16 additions and 16 deletions

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Buffers.Binary; using System.Buffers.Binary;
namespace DotRecast.Core namespace DotRecast.Core

View File

@ -67,22 +67,22 @@ namespace DotRecast.Core
// Returns true if 'a' is more lower-left than 'b'. // Returns true if 'a' is more lower-left than 'b'.
private static bool cmppt(Vector3f a, Vector3f b) private static bool cmppt(Vector3f a, Vector3f b)
{ {
if (a[0] < b[0]) if (a.x < b.x)
{ {
return true; return true;
} }
if (a[0] > b[0]) if (a.x > b.x)
{ {
return false; return false;
} }
if (a[2] < b[2]) if (a.z < b.z)
{ {
return true; return true;
} }
if (a[2] > b[2]) if (a.z > b.z)
{ {
return false; return false;
} }
@ -93,10 +93,10 @@ namespace DotRecast.Core
// Returns true if 'c' is left of line 'a'-'b'. // Returns true if 'c' is left of line 'a'-'b'.
private static bool left(Vector3f a, Vector3f b, Vector3f c) private static bool left(Vector3f a, Vector3f b, Vector3f c)
{ {
float u1 = b[0] - a[0]; float u1 = b.x - a.x;
float v1 = b[2] - a[2]; float v1 = b.z - a.z;
float u2 = c[0] - a[0]; float u2 = c.x - a.x;
float v2 = c[2] - a[2]; float v2 = c.z - a.z;
return u1 * v2 - v1 * u2 < 0; return u1 * v2 - v1 * u2 < 0;
} }
} }

View File

@ -83,9 +83,9 @@ namespace DotRecast.Core
float EPS = 1e-6f; float EPS = 1e-6f;
Vector3f d = new Vector3f(); Vector3f d = new Vector3f();
d.x = sq[0] - sp[0]; d.x = sq.x - sp.x;
d.y = sq[1] - sp[1]; d.y = sq.y - sp.y;
d.z = sq[2] - sp[2]; d.z = sq.z - sp.z;
float tmin = 0.0f; float tmin = 0.0f;
float tmax = 1.0f; float tmax = 1.0f;