Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • Returns a point at the given distance along this ray.

    Parameters

    • ray: Ray

      The ray to get the point on.

    • distance: number

      A distance from origin along the ray's direction.

    Returns Vector3

    A point on the ray.

  • create(value?: Partial<Ray>): Ray
  • Creates a new ray with the given values, or using default values if none are provided. The direction defaults to {x: 0, y: 0, z: -1} if undefined.

    Parameters

    • value: Partial<Ray> = {}

      The values of the ray.

    Returns Ray

    A new ray.

  • distanceToPlane(ray: Ray, plane: Plane): number | undefined
  • Computes the distance of the rays origin to the given plane. Returns a distance of 0 if the ray is coplanar and returns undefined if the ray does not intersect with the plane.

    Parameters

    • ray: Ray

      The ray to get the distance for.

    • plane: Plane

      The plane to compute the distance to.

    Returns number | undefined

    The distance to the plane, or undefined if it cannot be computed.

  • Computes the intersection point of the given ray to the given plane. If the ray does not intersect with the plane, then undefined is returned.

    Parameters

    • ray: Ray

      The ray to intersect.

    • plane: Plane

      The plane to intersect with.

    Returns Vector3 | undefined

    The intersection point, or undefined if the ray does not intersect.