Line3

A geometric line segment represented by a start and end point.

Constructor

Line3( start, end )

start -- Vector3 Start of the line segment
end -- Vector3 End of the line segment
The start and end vectors default to origin vectors if none are set.

Properties

.start

.end

Methods

.set ( start, end )

start -- Vector3
end -- Vector3
Sets the start and end values by copying the provided vectors.

.copy ( line )

line -- Line3
Copies the passed line's start and end vectors to this line.

.clone ()

Return a new copy of this Line3.

.equals ( line )

line -- Line3
Returns true if both line's start and end points are equal.

.distance ()

Returns the length of the line segment.

.distanceSq ()

Returns the line segment's length squared.

.applyMatrix4 ( matrix ) this

matrix -- Matrix4
Apply a matrix transform to the line segment.

.at ( t, optionalTarget )

t -- Float Use values 0-1 to return a result on the line segment.
optionalTarget -- Vector Optional target to set the result.
Return a vector at a certain position along the line. When t = 0, it returns the start vector, and when t=1 it returns the end vector.

.center ( optionalTarget )

optionalTarget -- Vector3 Optional target to set the result.
Return the center of the line segment.

.delta ( optionalTarget )

optionalTarget -- Vector3 Optional target to set the result.
Returns the delta vector of the line segment, or the end vector minus the start vector.

.closestPointToPoint ( point, clampToLine, optionalTarget )

point -- Vector3
clampToLine -- Boolean
optionalTarget -- Vector3 Optional target to set the result.
Returns the closets point on the line. If clamp to line is true, then the returned value will be clamped to the line segment.

.closestPointToPointParameter ( point, clampToLine )

point -- Vector3
clampToLine -- Boolean
Returns a point parameter based on the closest point as projected on the line segement. If clamp to line is true, then the returned value will be between 0 and 1.

Source

src/math/Line3.js
Edit