Class Ray3

Hierarchy

  • Ray3

Constructors

Properties

direction: Vector3
origin: Vector3

Methods

  • Create a copy of the ray

    Returns

    Ray3 object containing a copy of the original ray

    Returns Ray3

  • Creates a new Ray object in the local space of a given Transform

    Returns

    The ray in the local space of the Transform

    Parameters

    • transform: Node3

      The Transform object to create the local ray from

    Returns Ray3

  • Checks if the Ray intersects an Axis-Aligned Bounding Box

    Returns

    A Vector3 containing the intersection point or null if there is no intersection

    Parameters

    • transform: Node3

      The Transform of the Axis-Aligned Bounding Box

    Returns null | Vector3

  • Computes a brute force intersection test between a ray and a mesh

    Returns

    The intersection point if the ray intersects the mesh, otherwise null

    Parameters

    • mesh: Mesh3

      The mesh to test the intersection against

    Returns null | Vector3

  • Checks if the Ray intersects an Oriented Bounding Box

    Returns

    A Vector3 containing the intersection point or null if there is no intersection

    Parameters

    • transform: Node3

      The Transform of the Oriented Bounding Box

    Returns null | Vector3

  • Computes the intersection between a ray and an oriented bounding sphere

    Returns

    The intersection point if the ray intersects the bounding sphere, otherwise null

    Parameters

    • transform: Node3

      The transformation of the bounding sphere

    Returns null | Vector3

  • Computes the intersection between a ray and a series of triangles

    Returns

    The intersection point if the ray intersects the triangles, otherwise null

    Parameters

    • vertices: number[] | Vector3[]

      Array of either Vector3 objects or numbers representing the vertex positions

    • indices: number[]

      Array of indices representing the triangle faces

    Returns null | Vector3

  • Sets the Ray based on the device coordinates and camera

    Parameters

    • deviceCoords: Vector2

      A Vector2 containing the device coordinates

    • camera: Camera

      The Camera used to set the Ray

    Returns void

Generated using TypeDoc