Class Plane

The Plane implements a plane represented by a normal and a distance. The class follows the 'copy-on-write' pattern, which means that every operation returns a copy of the plane with updates values. It also implies that the values of the plane cannot be directly modified.

The concept of immutability improves sharing of objects as all types in TypeScript are assigned by identity, instead of by-value (e.g. a copy) as in other programming languages like C.

Constructors

  • Parameters

    Returns Plane

Properties

_d: number
_normal: Vector3

Accessors

  • get d(): number
  • Returns number

  • set d(value): void
  • Parameters

    • value: number

    Returns void

  • get normal(): Vector3
  • Returns Vector3

  • set normal(value): void
  • Parameters

    Returns void

Methods

  • Copies all properties defined by the prototype of Plane from other to this instance.

    Parameters

    Returns Plane

  • Clones this instance and returns a new Plane with identical values.

    Returns Plane

  • Returns a distance from point to plane.

    Parameters

    Returns number

    Distance to the plane. Will be positive if the point is on the positive side of the plane, negative if on the negative side of the plane, or zero if the point is on the plane.

  • Returns the side of the plane where the point is located on. No side signifies the point is on the plane.

    Parameters

    • point: Immutable<Vector3>

      Point to test.

    • Optionalepsilon: number

      Extra depth of the plane to help with precision issues.

    Returns EnumValue<PlaneSide, number>

    Side on the plane the point is located on.

  • Determines if this Plane instance is equal to the other instance.

    Parameters

    Returns boolean

  • Returns a string representation of an object.

    Returns string

  • Determines if both Plane instances are equal.

    Parameters

    Returns boolean

  • Creates a plane from a normal and a distance from the plane.

    Parameters

    • normal: Immutable<Vector3>

      Plane normal pointing in the positive half-space.

    • distance: number

      Distance of the plane from the origin, along the normal.

    Returns Plane

  • Creates a plane from a normal and a point on the plane.

    Parameters

    Returns Plane