Skip to content

Commit

Permalink
refactor: Change 'xyz' to uppercase in preparation for switching to S…
Browse files Browse the repository at this point in the history
…ystem.Numeric.Vector3
  • Loading branch information
ikpil committed Oct 12, 2023
1 parent 8d3a1d2 commit 7965af3
Show file tree
Hide file tree
Showing 108 changed files with 1,452 additions and 1,452 deletions.
16 changes: 8 additions & 8 deletions src/DotRecast.Core/RcConvexUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,22 @@ public static List<int> Convexhull(List<RcVec3f> pts)
// Returns true if 'a' is more lower-left than 'b'.
private static bool Cmppt(RcVec3f a, RcVec3f b)
{
if (a.x < b.x)
if (a.X < b.X)
{
return true;
}

if (a.x > b.x)
if (a.X > b.X)
{
return false;
}

if (a.z < b.z)
if (a.Z < b.Z)
{
return true;
}

if (a.z > b.z)
if (a.Z > b.Z)
{
return false;
}
Expand All @@ -92,10 +92,10 @@ private static bool Cmppt(RcVec3f a, RcVec3f b)
// Returns true if 'c' is left of line 'a'-'b'.
private static bool Left(RcVec3f a, RcVec3f b, RcVec3f c)
{
float u1 = b.x - a.x;
float v1 = b.z - a.z;
float u2 = c.x - a.x;
float v2 = c.z - a.z;
float u1 = b.X - a.X;
float v1 = b.Z - a.Z;
float u2 = c.X - a.X;
float v2 = c.Z - a.Z;
return u1 * v2 - v1 * u2 < 0;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/DotRecast.Core/RcIntersections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ public static bool IsectSegAABB(RcVec3f sp, RcVec3f sq, RcVec3f amin, RcVec3f am
const float EPS = 1e-6f;

RcVec3f d = new RcVec3f();
d.x = sq.x - sp.x;
d.y = sq.y - sp.y;
d.z = sq.z - sp.z;
d.X = sq.X - sp.X;
d.Y = sq.Y - sp.Y;
d.Z = sq.Z - sp.Z;
tmin = 0.0f;
tmax = float.MaxValue;

Expand Down
12 changes: 6 additions & 6 deletions src/DotRecast.Core/RcSegmentVert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ public struct RcSegmentVert

public RcSegmentVert(float v0, float v1, float v2, float v3, float v4, float v5)
{
vmin.x = v0;
vmin.y = v1;
vmin.z = v2;
vmin.X = v0;
vmin.Y = v1;
vmin.Z = v2;

vmax.x = v3;
vmax.y = v4;
vmax.z = v5;
vmax.X = v3;
vmax.Y = v4;
vmax.Z = v5;
}

}
Expand Down
22 changes: 11 additions & 11 deletions src/DotRecast.Core/RcVec2f.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ namespace DotRecast.Core
{
public struct RcVec2f
{
public float x;
public float y;
public float X;
public float Y;

public static RcVec2f Zero { get; } = new RcVec2f { x = 0, y = 0 };
public static RcVec2f Zero { get; } = new RcVec2f { X = 0, Y = 0 };

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float Get(int idx)
{
if (0 == idx)
return x;
return X;

if (1 == idx)
return y;
return Y;

throw new IndexOutOfRangeException("vector2f index out of range");
}
Expand All @@ -33,15 +33,15 @@ public override bool Equals(object obj)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(RcVec2f other)
{
return x.Equals(other.x) &&
y.Equals(other.y);
return X.Equals(other.X) &&
Y.Equals(other.Y);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
int hash = x.GetHashCode();
hash = RcHashCodes.CombineHashCodes(hash, y.GetHashCode());
int hash = X.GetHashCode();
hash = RcHashCodes.CombineHashCodes(hash, Y.GetHashCode());
return hash;
}

Expand All @@ -56,11 +56,11 @@ public override int GetHashCode()
{
return !left.Equals(right);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return $"{x}, {y}";
return $"{X}, {Y}";
}
}
}
Loading

0 comments on commit 7965af3

Please sign in to comment.