viewToRay

open fun viewToRay(viewPosition: Float2): Ray

Calculates a ray in world space going from the near-plane of the camera and through a point in view space.

Return

A Ray from the camera near to far / infinity

Parameters

viewPosition

normalized view coordinate x = (0 = left, 0.5 = center, 1 = right) y = (0 = bottom, 0.5 = center, 1 = top)