Class Plane

A two dimensional surface that extends infinitely in 3d space, represented in Hessian normal form by a unit length normal vector and a constant.

Hierarchy

  • Base
    • Plane

Constructors

  • Create a new instance.

    Parameters

    • Optional normal: Vector3

      (optional) a unit length Vector3 defining the normal of the plane. Default is (1, 0, 0).

    • Optional constant: number

      (optional) the signed distance from the origin to the plane. Default is 0.

    Returns Plane

Properties

constant: number
normal: Vector3

Accessors

  • get isBox2(): boolean
  • Returns boolean

  • get isBox3(): boolean
  • Returns boolean

  • get isColor(): boolean
  • Returns boolean

  • get isCylindrical(): boolean
  • Returns boolean

  • get isEuler(): boolean
  • Returns boolean

  • get isLine3(): boolean
  • Returns boolean

  • get isMatrix3(): boolean
  • Returns boolean

  • get isMatrix4(): boolean
  • Returns boolean

  • get isPlane(): boolean
  • Read-only flag to check if a given object is of type Plane.

    Returns boolean

  • get isQuaternion(): boolean
  • Returns boolean

  • get isRay(): boolean
  • Returns boolean

  • get isSphere(): boolean
  • Returns boolean

  • get isSpherical(): boolean
  • Returns boolean

  • get isTriangle(): boolean
  • Returns boolean

  • get isVector2(): boolean
  • Returns boolean

  • get isVector3(): boolean
  • Returns boolean

  • get isVector4(): boolean
  • Returns boolean

Methods

  • Apply a Matrix4 to the plane. The matrix must be an affine, homogeneous transform.If supplying an optionalNormalMatrix, it can be created like so:

    const optionalNormalMatrix = new Matrix3().getNormalMatrix( matrix );
    

    Returns

    This instance

    Parameters

    • matrix: Matrix4

      the Matrix4 to apply.

    • Optional optionalNormalMatrix: Matrix3

    Returns Plane

  • Create a new plane with the same normal and constant as this one.

    Returns

    The enw instance.

    Returns Plane

  • Compute a Vector3 coplanar to the plane, by calculating the projection of the normal vector at the origin onto the plane.

    Returns

    A vector coplanar to this plane.

    Parameters

    • target: Vector3

      — The result will be copied into this Vector3.

    Returns Vector3

  • Copies the values of the passed plane's normal and constant properties to this plane.

    Returns

    This instance.

    Parameters

    • plane: Plane

      The source plane to copy values from.

    Returns Plane

  • Compute the signed distance from the point to the plane.

    Returns

    The signed distance value.

    Parameters

    • point: Vector3

      The point to measure to.

    Returns number

  • Compute the signed distance from the sphere to the plane.

    Returns

    The signed distance value.

    Parameters

    • sphere: Sphere

      The sphere surface to measure to.

    Returns number

  • Checks to see if two planes are equal (their normal and constant properties match).

    Returns

    True if value-wise equal.

    Parameters

    • plane: Plane

      The plane to compare with.

    Returns boolean

  • Compute the intersection point of the passed line and the plane.

    Returns

    null if the line does not intersect; otherwise returns the line's starting point if the line is coplanar with the plane.

    Parameters

    • line: Line3

      the Line3 to check for intersection.

    • target: Vector3

      — the result will be copied into this Vector3.

    Returns null | Vector3

  • Determines whether or not this plane intersects box.

    Returns

    True if box and this plane intersect.

    Parameters

    • box: Box3

      the Box3 to check for intersection.

    Returns boolean

  • Tests whether a line segment intersects with (passes through) the plane.

    Returns

    True if the line intersect this plane.

    Parameters

    • line: Line3

      the Line3 to check for intersection.

    Returns boolean

  • Determines whether or not this plane intersects a sphere.

    Returns

    True if sphere and this plane intersect.

    Parameters

    • sphere: Sphere

      the Sphere to check for intersection.

    Returns boolean

  • Negates both the normal vector and the constant.

    Returns

    This instance.

    Returns Plane

  • Normalizes the normal vector, and adjusts the constant value accordingly.

    Returns

    This instance.

    Returns Plane

  • Projects a point onto the plane.

    Returns

    The projected point.

    Parameters

    • point: Vector3

      the Vector3 to project onto the plane.

    • target: Vector3

      the result will be copied into this Vector3.

    Returns Vector3

  • Sets this plane's normal and constant properties by copying the values from the given normal.

    Returns

    This instance.

    Parameters

    • normal: Vector3

      a unit length Vector3 defining the normal of the plane.

    • constant: number

      the signed distance from the origin to the plane. Default is 0.

    Returns Plane

  • Set the individual components that define the plane.

    Returns

    This instance.

    Parameters

    • x: number

      x value of the unit length normal vector.

    • y: number

      y value of the unit length normal vector.

    • z: number

      z value of the unit length normal vector.

    • w: number

      the value of the plane's constant property.

    Returns Plane

  • Defines the plane based on the 3 provided points. The winding order is assumed to be counter-clockwise, and determines the direction of the normal.

    Returns

    This instance.

    Parameters

    • a: Vector3

      first point on the plane.

    • b: Vector3

      secpmd point on the plane.

    • c: Vector3

      third point on the plane.

    Returns Plane

  • Sets the plane's properties as defined by a normal and an arbitrary coplanar point.

    Returns

    This instance.

    Parameters

    • normal: Vector3

      a unit length Vector3 defining the normal of the plane.

    • point: Vector3

      a Vector3 point

    Returns Plane

  • Translates the plane by the distance defined by the offset vector. Note that this only affects the plane constant and will not affect the normal vector.

    Returns

    This instance.

    Parameters

    • offset: Vector3

      the amount to move the plane by.

    Returns Plane