A Frustum description for perspective projection.
More...
#include <easy3d/renderer/frustum.h>
|
| Frustum (ProjectionType type) |
| Constructor with projection type.
|
|
void | orient (const vec3 &pos, const vec3 &at, const vec3 &up) |
| Sets the orientation of the frustum.
|
|
void | set_perspective (float fovy, float aspect, float znear, float zfar) |
| Sets the perspective projection parameters.
|
|
void | set_frustum (float frustum_width, float frustum_height, float znear, float zfar) |
| Sets the frustum parameters.
|
|
void | set_ortho (float xmin, float xmax, float ymin, float ymax, float znear, float zfar) |
| Sets the orthographic projection parameters.
|
|
mat4 | view_matrix () const |
| Returns the view matrix.
|
|
mat4 | projection_matrix () const |
| Returns the projection matrix.
|
|
vec3 | near_center () const |
| Returns the center point of the near plane in world space.
|
|
vec3 | far_center () const |
| Returns the center point of the far plane in world space.
|
|
float | near_width () const |
| Returns the width of the frustum at the near plane.
|
|
float | near_height () const |
| Returns the height of the frustum at the near plane.
|
|
float | far_width () const |
| Returns the width of the frustum at the far plane.
|
|
float | far_height () const |
| Returns the height of the frustum at the far plane.
|
|
const vec3 & | position () const |
| Returns the position of the frustum in world space.
|
|
vec3 | up_vector () const |
| Returns the up vector of the frustum in world space.
|
|
vec3 | right_vector () const |
| Returns the right vector of the frustum in world space.
|
|
float | near_distance () const |
| Returns the distance to the near clipping plane.
|
|
float | far_distance () const |
| Returns the distance to the far clipping plane.
|
|
std::vector< vec3 > | vertices () const |
| Computes the 8 corner points of the frustum in world space.
|
|
A Frustum description for perspective projection.
◆ ProjectionType
Types of projection.
Enumerator |
---|
PERSPECTIVE | perspective projection
|
ORTHO | orthographic projection
|
◆ Frustum()
Constructor with projection type.
- Parameters
-
type | The type of projection. |
◆ far_center()
vec3 far_center |
( |
| ) |
const |
Returns the center point of the far plane in world space.
- Returns
- The center point of the far plane.
◆ far_distance()
float far_distance |
( |
| ) |
const |
|
inline |
Returns the distance to the far clipping plane.
- Returns
- The far clipping plane distance.
◆ far_height()
float far_height |
( |
| ) |
const |
Returns the height of the frustum at the far plane.
- Returns
- The height of the far plane.
◆ far_width()
float far_width |
( |
| ) |
const |
Returns the width of the frustum at the far plane.
- Returns
- The width of the far plane.
◆ near_center()
vec3 near_center |
( |
| ) |
const |
Returns the center point of the near plane in world space.
- Returns
- The center point of the near plane.
◆ near_distance()
float near_distance |
( |
| ) |
const |
|
inline |
Returns the distance to the near clipping plane.
- Returns
- The near clipping plane distance.
◆ near_height()
float near_height |
( |
| ) |
const |
Returns the height of the frustum at the near plane.
- Returns
- The height of the near plane.
◆ near_width()
float near_width |
( |
| ) |
const |
Returns the width of the frustum at the near plane.
- Returns
- The width of the near plane.
◆ orient()
void orient |
( |
const vec3 & | pos, |
|
|
const vec3 & | at, |
|
|
const vec3 & | up ) |
Sets the orientation of the frustum.
- Parameters
-
pos | The position of the frustum. |
at | The point the frustum is looking at. |
up | The up direction of the frustum. |
◆ position()
const vec3 & position |
( |
| ) |
const |
|
inline |
Returns the position of the frustum in world space.
- Returns
- The position of the frustum.
◆ projection_matrix()
mat4 projection_matrix |
( |
| ) |
const |
Returns the projection matrix.
- Returns
- The projection matrix.
◆ right_vector()
vec3 right_vector |
( |
| ) |
const |
Returns the right vector of the frustum in world space.
- Returns
- The right vector.
◆ set_frustum()
void set_frustum |
( |
float | frustum_width, |
|
|
float | frustum_height, |
|
|
float | znear, |
|
|
float | zfar ) |
Sets the frustum parameters.
- Parameters
-
frustum_width | The width of the frustum. |
frustum_height | The height of the frustum. |
znear | The near clipping plane. |
zfar | The far clipping plane. |
◆ set_ortho()
void set_ortho |
( |
float | xmin, |
|
|
float | xmax, |
|
|
float | ymin, |
|
|
float | ymax, |
|
|
float | znear, |
|
|
float | zfar ) |
Sets the orthographic projection parameters.
- Parameters
-
xmin | The minimum x value. |
xmax | The maximum x value. |
ymin | The minimum y value. |
ymax | The maximum y value. |
znear | The near clipping plane. |
zfar | The far clipping plane. |
◆ set_perspective()
void set_perspective |
( |
float | fovy, |
|
|
float | aspect, |
|
|
float | znear, |
|
|
float | zfar ) |
Sets the perspective projection parameters.
- Parameters
-
fovy | The field of view in the y direction, in radians. |
aspect | The aspect ratio of the frustum. |
znear | The near clipping plane. |
zfar | The far clipping plane. |
◆ up_vector()
Returns the up vector of the frustum in world space.
- Returns
- The up vector.
◆ vertices()
std::vector< vec3 > vertices |
( |
| ) |
const |
Computes the 8 corner points of the frustum in world space.
- Returns
- A vector containing the 8 corner points.
◆ view_matrix()
mat4 view_matrix |
( |
| ) |
const |
Returns the view matrix.
- Returns
- The view matrix.
The documentation for this class was generated from the following files:
- G:/3_code/Easy3D/easy3d/renderer/frustum.h
- G:/3_code/Easy3D/easy3d/renderer/frustum.cpp