Engine API Reference - v2.6.1
    Preparing search index...

    Class Plane

    An infinite plane. Internally it's represented in a parametric equation form: ax + by + cz + distance = 0.

    Index

    Constructors

    • Create a new Plane instance.

      Parameters

      • Optionalnormal: Vec3 = Vec3.UP

        Normal of the plane. The constructor copies this parameter. Defaults to Vec3.UP.

      • Optionaldistance: number = 0

        The distance from the plane to the origin, along its normal. Defaults to 0.

      Returns Plane

    Properties

    distance: number

    The distance from the plane to the origin, along its normal.

    normal: Vec3 = ...

    The normal of the plane.

    Methods

    • Copies the contents of a source plane to a destination plane.

      Parameters

      • src: Plane

        A source plane to copy to the destination plane.

      Returns Plane

      Self for chaining.

    • Test if the plane intersects between two points.

      Parameters

      • start: Vec3

        Start position of line.

      • end: Vec3

        End position of line.

      • Optionalpoint: Vec3

        If there is an intersection, the intersection point will be copied into here.

      Returns boolean

      True if there is an intersection.

    • Test if a ray intersects with the infinite plane.

      Parameters

      • ray: Ray

        Ray to test against (direction must be normalized).

      • Optionalpoint: Vec3

        If there is an intersection, the intersection point will be copied into here.

      Returns boolean

      True if there is an intersection.

    • Sets the plane based on a normal and a distance from the origin.

      Parameters

      • nx: number

        The x-component of the normal.

      • ny: number

        The y-component of the normal.

      • nz: number

        The z-component of the normal.

      • d: number

        The distance from the origin.

      Returns Plane

      Self for chaining.

    • Sets the plane based on a specified normal and a point on the plane.

      Parameters

      • point: Vec3

        The point on the plane.

      • normal: Vec3

        The normal of the plane.

      Returns Plane

      Self for chaining.