Nebula
Loading...
Searching...
No Matches
RenderUtil::MouseRayUtil Class Reference

#include <mouserayutil.h>

Detailed Description

Helper class to compute a world-space ray from mouse coords.

Static Public Member Functions

static Math::line ComputeWorldMouseRay (const Math::vec2 &mousePos, float length, const Math::mat4 &invViewMatrix, const Math::mat4 &invProjMatrix, float nearPlane)
 compute world-space ray from mouse position (mouse position is expected in the range 0..1)
 
static Math::line ComputeWorldMouseRayOrtho (const Math::vec2 &mousePos, float length, const Math::mat4 &invViewMatrix, const Math::mat4 &invProjMatrix, float nearPlane)
 compute world-space ray from mouse position (mouse position is expected in the range 0..1). Assumes projection matrix is orthographic
 

Member Function Documentation

◆ ComputeWorldMouseRay()

line RenderUtil::MouseRayUtil::ComputeWorldMouseRay ( const Math::vec2 & mousePos,
float length,
const Math::mat4 & invViewMatrix,
const Math::mat4 & invProjMatrix,
float nearPlane )
static

compute world-space ray from mouse position (mouse position is expected in the range 0..1)

Utility function which computes a ray in world space between the eye and the current mouse position on the near plane of a perspective view frustum.

Mouse position is expected in the range 0..1.

◆ ComputeWorldMouseRayOrtho()

line RenderUtil::MouseRayUtil::ComputeWorldMouseRayOrtho ( const Math::vec2 & mousePos,
float length,
const Math::mat4 & invViewMatrix,
const Math::mat4 & invProjMatrix,
float nearPlane )
static

compute world-space ray from mouse position (mouse position is expected in the range 0..1). Assumes projection matrix is orthographic

Utility function which computes a ray that extends in world space between mouse position on the near plane and length in cameras z direction Mouse position is expected in the range 0..1.

Todo
There are better ways to do this!

The documentation for this class was generated from the following files: