Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Ray

Hierarchy

  • Ray

Index

Constructors

constructor

Properties

Private _camera

_camera: AbstractCamera = null

Private _direction

_direction: vec3 = null

Private _origin

_origin: vec3 = null

Methods

Private _getCameraCoords

  • _getCameraCoords(pt: vec4): vec4
  • Converts clip-space coordinates into camera-space coordinates

    Parameters

    • pt: vec4

      The 4d clip-space vector to convert into camera-space

    Returns vec4

Private _getClipCoords

  • _getClipCoords(pt: vec2): vec4
  • Converts device-space coordinates into clip-space coordinates

    Parameters

    • pt: vec2

      The 2d vector to convert into clip-space

    Returns vec4

Private _getDeviceCoords

  • _getDeviceCoords(x: number, y: number): vec2
  • Converts screen-space coordinates into device-space coordinates

    Parameters

    • x: number

      The X coordinate in screen-space

    • y: number

      The Y coordinate in screen-space

    Returns vec2

Private _getRayCoords

  • _getRayCoords(pt: vec4): vec3
  • Converts camera-space coordinates into a direction

    Parameters

    • pt: vec4

      The 4d camera-space vector to convert into a direction

    Returns vec3

fromCameraCenter

  • fromCameraCenter(): Ray

fromMousePosition

  • fromMousePosition(x: number, y: number): Ray
  • Create a world-space ray based on the provided mouse position

    Parameters

    • x: number

      The mouse X coordinate

    • y: number

      The mouse Y coordinate

    Returns Ray

getDirection

  • getDirection(): vec3

getOrigin

  • getOrigin(): vec3

intersectsAABB

intersectsTriangle

Generated using TypeDoc