dot big bang

Developer API
Menu

Class Line3

All
  • Public
  • Public/Protected
  • All

Hierarchy

  • Line3

Index

Constructors

constructor

  • Creates a new Line3.

    Parameters

    • Optional start: Vector3

      The start point of the line segment. Default is (0, 0, 0).

    • Optional end: Vector3

      The end point of the line segment. Default is (0, 0, 0).

    Returns Line3

Properties

end

end: Vector3

The end point of the line segment.

start

start: Vector3

The start point of the line segment.

Methods

applyMatrix4

  • Applies a matrix transform to the line segment.

    Parameters

    • matrix: Matrix4

      The Matrix4 to apply to this line segment.

    Returns Line3

at

  • Returns a point at a certain position along the line segment. When t = 0, it returns the start vector, and when t = 1 it returns the end vector.

    Parameters

    • t: number

      The position along the line segment, in the 0-1 range.

    • Optional optionalTarget: Vector3

      the result will be copied into this Vector3.

    Returns Vector3

center

  • Returns the center of the line segment.

    Parameters

    • Optional optionalTarget: Vector3

      the result will be copied into this Vector3.

    Returns Vector3

clone

  • Returns a new Line3 with the same start and end vectors as this one.

    Returns Line3

closestPointToPoint

  • Returns the closets point on the line segment. If clampToLine is true, then the returned value will be clamped to the line segment.

    Parameters

    • point: Vector3

      return the closest point on the line to this point.

    • clampToLine: boolean

      whether to clamp the returned value to the line segment.

    • Optional optionalTarget: Vector3

    Returns Vector3

closestPointToPointParameter

  • closestPointToPointParameter(point: Vector3, clampToLine: boolean): number
  • Returns a point parameter based on the closest point as projected on the line segement. If clampToLine is true, then the returned value will be between 0 and 1.

    Parameters

    • point: Vector3

      The point for which to return a point parameter.

    • clampToLine: boolean

      Whether to clamp the result to the range [0, 1].

    Returns number

copy

  • Copies the passed line segment's start and end vectors to this line.

    Parameters

    • line3: Line3

      The other line segments to copy the start and end points from.

    Returns Line3

delta

  • Returns the delta vector of the line segment (end vector minus the start vector).

    Parameters

    • Optional optionalTarget: Vector3

      The result will be copied into this Vector3.

    Returns Vector3

distance

  • distance(): number
  • Returns the Euclidean distance (straight-line distance) between the line segment's start and end points.

    Returns number

distanceSq

  • distanceSq(): number
  • Returns the square of the Euclidean distance (straight-line distance) between the line segment's start and end points.

    Returns number

equals

  • Returns true if both line segment's start and end points are equal.

    Parameters

    Returns Line3

set

  • Sets the start and end points of this line segment by copying the provided vectors.

    Parameters

    • start: Vector3

      The start point of the line segment.

    • end: Vector3

      The end point of the line segment.

    Returns Line3