11using System.Collections;
12using System.Collections.Generic;
31 if ((
a -
b).sqrMagnitude <
float.Epsilon)
return 0f;
32 return (pointOnSegment -
a).magnitude / (
b -
a).magnitude;
55 return Collision.Intersect(
this, rect);
60 #region Runtime Gizmos
void DrawLine(Vector3 a, Vector3 b)
Draws a gizmo line that connects the two positions.
Vector3 Evaluate(float t)
LocalSegment3 Transform(Matrix4x4 m, bool fullMultiply=false)
float Parameterize(Vector3 pointOnSegment)
Given a point on the segment, parameterizes that point into a value such that a + (b - a)....
LocalSegment3(Vector3 a, Vector3 b)
void DrawRuntimeGizmos(RuntimeGizmoDrawer drawer)
float Intersect(Rect rect)
Returns the squared distance between this line segment and the rect.