Capítulo 352 de 859

Chapter 352: Line3

Core Idea

An analytical line segment in 3D space represented by a start and end point.

Key Concepts

  • end : Vector3: End of the line segment.
  • start : Vector3: Start of the line segment.

Reference Tables

Constructor

Signature
new Line3( start : Vector3, end : Vector3 )

Properties

PropertyDescription
.end : Vector3End of the line segment.
.start : Vector3Start of the line segment.

Methods

MethodDescription
.applyMatrix4( matrix : Matrix4 ) : Line3Applies a 4x4 transformation matrix to this line segment.
.at( t : number, target : Vector3 ) : Vector3Returns a vector at a certain position along the line segment.
.clone() : Line3Returns a new line segment with copied values from this instance.
.closestPointToPoint( point : Vector3, clampToLine : boolean, target : Vector3 ) : Vector3Returns the closest point on the line for a given point.
.closestPointToPointParameter( point : Vector3, clampToLine : boolean ) : numberReturns a point parameter based on the closest point as projected on the line segment.
.copy( line : Line3 ) : Line3Copies the values of the given line segment to this instance.
.delta( target : Vector3 ) : Vector3Returns the delta vector of the line segment's start and end point.
.distance() : numberReturns the Euclidean distance between the line' start and end point.
.distanceSq() : numberReturns the squared Euclidean distance between the line' start and end point.
.distanceSqToLine3( line : Line3, c1 : Vector3, c2 : Vector3 ) : numberReturns the closest squared distance between this line segment and the given one.
.equals( line : Line3 ) : booleanReturns true if this line segment is equal with the given one.
.getCenter( target : Vector3 ) : Vector3Returns the center of the line segment.
.set( start : Vector3, end : Vector3 ) : Line3Sets the start and end values by copying the given vectors.

Key Takeaways

  1. Most relevant properties: end, start.
  2. Key methods: applyMatrix4, at, clone, closestPointToPoint.

Connects To