[name]

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

Constructor

[name]([page:Vector3 start], [page:Vector3 end])

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

Properties

.[page:Vector3 start]

.[page:Vector3 end]

Methods

.set([page:Vector3 start], [page:Vector3 end]) [page:Line3]

start -- [page:Vector3]
end -- [page:Vector3]
Sets the start and end values by copying the provided vectors.

.copy([page:Line3 line]) [page:Line3]

line -- [page:Line3]
Copies the passed line's start and end vectors to this line.

.clone() [page:Line3]

Return a new copy of this [page:Line3].

.equals([page:Line3 line]) [page:Boolean]

line -- [page:Line3]

.distance() [page:Float]

Returns the length of the line segment.
Returns true if both line's start and end points are equal.

.distanceSq() [page:Float]

Returns the line segment's length squared.

.applyMatrix4([page:Matrix4 matrix]) [page:Line3 this]

matrix -- [page:Matrix4]
Apply a matrix transform to the line segment.

.at([page:Float t], [page:Vector3 optionalTarget]) [page:Vector]

t -- [page:Float] Use values 0-1 to return a result on the line segment.
optionalTarget -- [page: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([page:Vector3 optionalTarget]) [page:Vector3]

optionalTarget -- [page:Vector3] Optional target to set the result.
Return the center of the line segment.

.delta([page:Vector3 optionalTarget]) [page:Vector3]

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

.closestPointToPoint([page:Vector3 point], [page:Boolean clampToLine], [page:Vector3 optionalTarget]) [page:Vector3]

point -- [page:Vector3]
clampToLine -- [page:Boolean]
optionalTarget -- [page: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([page:Vector3 point], [page:Boolean clampToLine]) [page:Float]

point -- [page:Vector3]
clampToLine -- [page: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

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]