#include "gcl/Geometry.h"
#include "cl/String.h"
#include <iostream.h>
Include dependency graph for Camera.h:
Go to the source code of this file.
FindWorldRay maps from display coords ([-1, 1], [-1, 1]) to a ray through the world.
We assume our world-to-screen matrix maps from some form of view pyramid to the box from -1 to 1 in x and y and 0 to 1 in z.
Note that this works regardless of whether a perspective or orthogonal projection is used; the only thing you need is the inverse WS matrix:
inverseW2S = inv(camera.ProjMatrix() * camera.ModelMatrix);