Exemplo n.º 1
0
 static function getPoint($x, $y, Camera $camera, $screenWidth, $screenHeight)
 {
     $recenterX = ($x - $screenWidth / 2.0) / 2.0 / $screenWidth;
     $recenterY = -($y - $screenHeight / 2.0) / 2.0 / $screenHeight;
     $a = Vector::times($recenterX, $camera->right);
     $b = Vector::times($recenterY, $camera->up);
     $c = Vector::plus($a, $b);
     return Vector::norm(Vector::plus($camera->forward, $c));
 }