|
| ray () |
| Construct an invalid ray with origin at zero and undefined direction.
|
|
| ray (const fvec< T, 3 > &origin, const fvec< T, 3 > &direction) |
| Construct a ray with given origin and direction.
|
|
| ray (const fvec< T, 2 > &screen_coord, const fvec< unsigned, 2 > &viewport_size, const fvec< T, 3 > &eye_position, const fmat< T, 4, 4 > &view_projection_matrix) |
| Construct a ray from a given screen coordinate and view parameters.
|
|
fvec< T, 3 > | position (float t) const |
| Returns the position of the ray at the given distance (ray parameter t) from its origin.
|
|
template<typename T>
class cgv::math::ray< T, 3 >
Partial specialization of ray class for 3 dimensions.
Definition at line 39 of file ray.h.
template<typename T >
cgv::math::ray< T, 3 >::ray |
( |
const fvec< T, 2 > & |
screen_coord, |
|
|
const fvec< unsigned, 2 > & |
viewport_size, |
|
|
const fvec< T, 3 > & |
eye_position, |
|
|
const fmat< T, 4, 4 > & |
view_projection_matrix |
|
) |
| |
|
inline |
Construct a ray from a given screen coordinate and view parameters.
This is typically used to create a viewing ray that originates at the eye and goes through a pixel on the screen.
- Parameters
-
screen_coord | the screen pixel coordinate with (0,0) in the bottom left corner. |
viewport_size | the screen size in pixels. |
eye_position | the location of the eye/camera. |
view_projection_matrix | the current view and projection matrix with no (or identity) model transformation. |
Definition at line 61 of file ray.h.
References cgv::math::fvec< T, N >::w(), cgv::math::fvec< T, N >::x(), and cgv::math::fvec< T, N >::y().