Fixed some bugs, generally refining stuff.

This commit is contained in:
CloneTrooper1019
2019-02-04 13:30:33 -06:00
parent ebd56d22a7
commit 2be61916de
23 changed files with 436 additions and 221 deletions

View File

@ -4,11 +4,13 @@
{
public readonly float Time;
public readonly Color3 Value;
public readonly byte[] Reserved;
public ColorSequenceKeypoint(float time, Color3 value)
public ColorSequenceKeypoint(float time, Color3 value, byte[] reserved = null)
{
Time = time;
Value = value;
Reserved = reserved;
}
public override string ToString()

View File

@ -34,10 +34,10 @@
public Vector3 ClosestPoint(Vector3 point)
{
Vector3 result = Origin;
float t = Direction.Dot(point - result);
float dist = Direction.Dot(point - result);
if (t >= 0)
result += (Direction * t);
if (dist >= 0)
result += (Direction * dist);
return result;
}
@ -45,7 +45,7 @@
public float Distance(Vector3 point)
{
Vector3 closestPoint = ClosestPoint(point);
return (closestPoint - point).Magnitude;
return (point - closestPoint).Magnitude;
}
}
}