dot big bang

Developer API
Menu

Class Plane

All
  • Public
  • Public/Protected
  • All

Hierarchy

  • Plane

Index

Constructors

constructor

  • Creates a new Plane.

    Parameters

    • Optional normal: Vector3

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

    • Optional constant: number

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

    Returns Plane

Properties

contant

contant: number

The signed distance from the origin to the plane.

normal

normal: Vector3

The unit length normal vector defining the plane.

Methods

applyMatrix4

  • Apply a Matrix4 transform to this plane. The matrix must be an affine, homogeneous transform.

    Parameters

    • m: Matrix4

      The matrix to apply to this plane

    Returns Plane

clone

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

    Returns Plane

coplanarPoint

  • Returns a point coplanar to this plane, by calculating the projection of the normal vector at the origin onto this plane.

    Parameters

    • Optional optionalTarget: Vector3

      The result will be copied into this Vector3.

    Returns Vector3

copy

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

    Parameters

    • v: Plane

      The plane to copy into this one.

    Returns Plane

distanceToPoint

  • distanceToPoint(point: Vector3): number
  • Returns the signed distance from the point to this plane.

    Parameters

    Returns number

distanceToSphere

  • distanceToSphere(sphere: Sphere): number
  • Returns the signed distance from the sphere to this plane.

    Parameters

    • sphere: Sphere

      The sphere to calculate the distance to.

    Returns number

equals

  • equals(v: Plane): boolean
  • Return true if both plane's normal and constant are equal

    Parameters

    • v: Plane

      The other plane to compare this one against.

    Returns boolean

intersectLine

  • Returns the intersection point of the passed line and this plane. Returns undefined if the line does not intersect. Returns the line's starting point if the line is coplanar with this plane.

    Parameters

    • line: Line3

      The line segment to check for intersection.

    • Optional optionalTarget: Vector3

      The result will be copied into this Vector3.

    Returns Vector3

intersectsBox

  • intersectsBox(box: Box3): boolean
  • Determines whether or not this plane intersects box.

    Parameters

    • box: Box3

      The box to check for intersection.

    Returns boolean

intersectsLine

  • intersectsLine(line: Line3): boolean
  • Tests whether a line segment intersects with (passes through) this plane.

    Parameters

    • line: Line3

      the [page:Line3] to check for intersection.

    Returns boolean

intersectsSphere

  • intersectsSphere(sphere: Sphere): boolean
  • Determines whether or not this plane intersects sphere.

    Parameters

    • sphere: Sphere

      The sphere to check for intersection.

    Returns boolean

negate

  • Negates both the normal vector and the constant of this plane.

    Returns Plane

normalize

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

    Returns Plane

orthoPoint

  • Returns a vector in the same direction as this plane's normal, but which magnitude is the point's original distance to the plane.

    Parameters

    • point: Vector3

      The point which distance to the plane is used as magnitude of the resulting vector.

    • Optional optionalTarget: Vector3

      The result will be copied into this Vector3.

    Returns Vector3

projectPoint

  • Projects a point onto this plane.

    Parameters

    • point: Vector3

      The point to project onto the plane.

    • Optional optionalTarget: Vector3

      The result will be copied into this Vector3.

    Returns Vector3

set

  • Sets this plane's normal and constant properties from the provided ones.

    Parameters

    • normal: Vector3

      A unit length Vector3 defining the normal of the plane.

    • constant: number

      The signed distance from the origin to the plane.

    Returns Plane

setComponents

  • setComponents(x: number, y: number, z: number, w: number): Plane
  • Sets the individual components that define this plane.

    Parameters

    • x: number

      The x value of the unit length normal vector.

    • y: number

      The y value of the unit length normal vector.

    • z: number

      The z value of the unit length normal vector.

    • w: number

      The value of the plane's constant property.

    Returns Plane

setFromCoplanarPoints

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

    Parameters

    • a: Vector3

      The first point on the plane.

    • b: Vector3

      The second point on the plane.

    • c: Vector3

      The third point on the plane.

    Returns Plane

setFromNormalAndCoplanarPoint

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

    Parameters

    • normal: Vector3

      A unit length Vector3 defining the normal of the plane.

    • point: Vector3

      A point coplanar to the plane to define.

    Returns Plane

translate

  • Translates the plane by the distance defined by the offset vector. Note that this only affects the plane constant and doesn't affect the normal vector.

    Parameters

    • offset: Vector3

      The amount to move the plane by.

    Returns Plane