Fixed some bugs, generally refining stuff.
This commit is contained in:
@ -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()
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user