gophergfx
    Preparing search index...

    Class Ray3

    Index
    direction: Vector3
    origin: Vector3
    • Create a copy of the ray

      Returns Ray3

      Ray3 object containing a copy of the original ray

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

      Parameters

      • transform: Node3

        The Transform object to create the local ray from

      Returns Ray3

      The ray in the local space of the Transform

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

      Parameters

      • transform: Node3

        The Transform of the Axis-Aligned Bounding Box

      Returns Vector3 | null

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

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

      Parameters

      • mesh: Mesh3

        The mesh to test the intersection against

      Returns Vector3 | null

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

    • Checks if the Ray intersects an Oriented Bounding Box

      Parameters

      • transform: Node3

        The Transform of the Oriented Bounding Box

      Returns Vector3 | null

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

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

      Parameters

      • transform: Node3

        The transformation of the bounding sphere

      Returns Vector3 | null

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

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

      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 Vector3 | null

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

    • Sets the origin and direction of the Ray

      Parameters

      • origin: Vector3

        The origin of the Ray

      • direction: Vector3

        The direction of the Ray

      Returns void

    • 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