Saga3D API Documentation  1.0-RC4
saga::scene::SViewFrustum Struct Reference

Defines the view frustum. That's the space visible by the camera. More...

#include <SViewFrustum.h>

Public Types

enum  E_PLANES {
  E_PLANES::FAR, E_PLANES::NEAR, E_PLANES::LEFT, E_PLANES::RIGHT,
  E_PLANES::BOTTOM, E_PLANES::TOP
}
 

Public Member Functions

 SViewFrustum ()
 Default Constructor. More...
 
 SViewFrustum (const SViewFrustum &other)
 Copy Constructor. More...
 
 SViewFrustum (const glm::mat4 &mat)
 This constructor creates a view frustum based on a projection and/or view matrix. More...
 
void setFrom (const glm::mat4 &mat)
 This constructor creates a view frustum based on a projection and/or view matrix. More...
 
void transform (const glm::mat4 &mat)
 transforms the frustum by the matrix More...
 
glm::vec3 getFarLeftUp () const
 returns the point which is on the far left upper corner inside the the view frustum. More...
 
glm::vec3 getFarLeftDown () const
 returns the point which is on the far left bottom corner inside the the view frustum. More...
 
glm::vec3 getFarRightUp () const
 returns the point which is on the far right top corner inside the the view frustum. More...
 
glm::vec3 getFarRightDown () const
 returns the point which is on the far right bottom corner inside the the view frustum. More...
 
glm::vec3 getNearLeftUp () const
 returns the point which is on the near left upper corner inside the the view frustum. More...
 
glm::vec3 getNearLeftDown () const
 returns the point which is on the near left bottom corner inside the the view frustum. More...
 
glm::vec3 getNearRightUp () const
 returns the point which is on the near right top corner inside the the view frustum. More...
 
glm::vec3 getNearRightDown () const
 returns the point which is on the near right bottom corner inside the the view frustum. More...
 
const core::aabbox3d< float > & getBoundingBox () const
 returns a bounding box enclosing the whole view frustum More...
 
void recalculateBoundingBox ()
 recalculates the bounding box and sphere based on the planes More...
 
float getBoundingRadius () const
 get the bounding sphere's radius (of an optimized sphere, not the AABB's) More...
 
glm::vec3 getBoundingCenter () const
 get the bounding sphere's radius (of an optimized sphere, not the AABB's) More...
 
void setFarNearDistance (float distance)
 the cam should tell the frustum the distance between far and near More...
 
glm::mat4 & getTransform (video::E_TRANSFORM_STATE state)
 get the given state's matrix based on frustum E_TRANSFORM_STATE More...
 
const glm::mat4 & getTransform (video::E_TRANSFORM_STATE state) const
 get the given state's matrix based on frustum E_TRANSFORM_STATE More...
 
bool clipLine (core::line3d< float > &line) const
 clips a line to the view frustum. More...
 
core::plane3d< float > & plane (E_PLANES type)
 
core::plane3d< float > plane (E_PLANES type) const
 

Public Attributes

glm::vec3 cameraPosition
 the position of the camera More...
 
std::array< core::plane3d< float >, VIEW_FRUSTUM_PLANE_COUNTplanes
 all planes enclosing the view frustum. More...
 
core::aabbox3d< float > boundingBox
 bounding box around the view frustum More...
 

Detailed Description

Defines the view frustum. That's the space visible by the camera.

The view frustum is enclosed by 6 planes. These six planes share eight points. A bounding box around these eight points is also stored in this structure.

Definition at line 29 of file SViewFrustum.h.

Member Enumeration Documentation

◆ E_PLANES

Enumerator
FAR 

Far plane of the frustum. That is the plane furthest away from the eye.

NEAR 

Near plane of the frustum. That is the plane nearest to the eye.

LEFT 

Left plane of the frustum.

RIGHT 

Right plane of the frustum.

BOTTOM 

Bottom plane of the frustum.

TOP 

Top plane of the frustum.

Definition at line 31 of file SViewFrustum.h.

Constructor & Destructor Documentation

◆ SViewFrustum() [1/3]

saga::scene::SViewFrustum::SViewFrustum ( )
inline

Default Constructor.

Definition at line 48 of file SViewFrustum.h.

◆ SViewFrustum() [2/3]

saga::scene::SViewFrustum::SViewFrustum ( const SViewFrustum other)
inline

Copy Constructor.

Copy constructor ViewFrustum

Definition at line 148 of file SViewFrustum.h.

◆ SViewFrustum() [3/3]

saga::scene::SViewFrustum::SViewFrustum ( const glm::mat4 &  mat)
inline

This constructor creates a view frustum based on a projection and/or view matrix.

Definition at line 165 of file SViewFrustum.h.

Member Function Documentation

◆ clipLine()

bool saga::scene::SViewFrustum::clipLine ( core::line3d< float > &  line) const
inline

clips a line to the view frustum.

Clips a line to the frustum.

Returns
True if the line was clipped, false if not

Definition at line 363 of file SViewFrustum.h.

◆ getBoundingBox()

const core::aabbox3d< float > & saga::scene::SViewFrustum::getBoundingBox ( ) const
inline

returns a bounding box enclosing the whole view frustum

Definition at line 259 of file SViewFrustum.h.

◆ getBoundingCenter()

glm::vec3 saga::scene::SViewFrustum::getBoundingCenter ( ) const
inline

get the bounding sphere's radius (of an optimized sphere, not the AABB's)

Definition at line 282 of file SViewFrustum.h.

◆ getBoundingRadius()

float saga::scene::SViewFrustum::getBoundingRadius ( ) const
inline

get the bounding sphere's radius (of an optimized sphere, not the AABB's)

Definition at line 277 of file SViewFrustum.h.

◆ getFarLeftDown()

glm::vec3 saga::scene::SViewFrustum::getFarLeftDown ( ) const
inline

returns the point which is on the far left bottom corner inside the the view frustum.

Definition at line 189 of file SViewFrustum.h.

◆ getFarLeftUp()

glm::vec3 saga::scene::SViewFrustum::getFarLeftUp ( ) const
inline

returns the point which is on the far left upper corner inside the the view frustum.

Definition at line 179 of file SViewFrustum.h.

◆ getFarRightDown()

glm::vec3 saga::scene::SViewFrustum::getFarRightDown ( ) const
inline

returns the point which is on the far right bottom corner inside the the view frustum.

Definition at line 209 of file SViewFrustum.h.

◆ getFarRightUp()

glm::vec3 saga::scene::SViewFrustum::getFarRightUp ( ) const
inline

returns the point which is on the far right top corner inside the the view frustum.

Definition at line 199 of file SViewFrustum.h.

◆ getNearLeftDown()

glm::vec3 saga::scene::SViewFrustum::getNearLeftDown ( ) const
inline

returns the point which is on the near left bottom corner inside the the view frustum.

Definition at line 229 of file SViewFrustum.h.

◆ getNearLeftUp()

glm::vec3 saga::scene::SViewFrustum::getNearLeftUp ( ) const
inline

returns the point which is on the near left upper corner inside the the view frustum.

Definition at line 219 of file SViewFrustum.h.

◆ getNearRightDown()

glm::vec3 saga::scene::SViewFrustum::getNearRightDown ( ) const
inline

returns the point which is on the near right bottom corner inside the the view frustum.

Definition at line 249 of file SViewFrustum.h.

◆ getNearRightUp()

glm::vec3 saga::scene::SViewFrustum::getNearRightUp ( ) const
inline

returns the point which is on the near right top corner inside the the view frustum.

Definition at line 239 of file SViewFrustum.h.

◆ getTransform() [1/2]

glm::mat4 & saga::scene::SViewFrustum::getTransform ( video::E_TRANSFORM_STATE  state)
inline

get the given state's matrix based on frustum E_TRANSFORM_STATE

View Frustum depends on Projection & View Matrix

Definition at line 349 of file SViewFrustum.h.

◆ getTransform() [2/2]

const glm::mat4 & saga::scene::SViewFrustum::getTransform ( video::E_TRANSFORM_STATE  state) const
inline

get the given state's matrix based on frustum E_TRANSFORM_STATE

View Frustum depends on Projection & View Matrix

Definition at line 357 of file SViewFrustum.h.

◆ plane() [1/2]

core::plane3d<float>& saga::scene::SViewFrustum::plane ( E_PLANES  type)
inline

Definition at line 115 of file SViewFrustum.h.

◆ plane() [2/2]

core::plane3d<float> saga::scene::SViewFrustum::plane ( E_PLANES  type) const
inline

Definition at line 117 of file SViewFrustum.h.

◆ recalculateBoundingBox()

void saga::scene::SViewFrustum::recalculateBoundingBox ( )
inline

recalculates the bounding box and sphere based on the planes

Definition at line 264 of file SViewFrustum.h.

◆ setFarNearDistance()

void saga::scene::SViewFrustum::setFarNearDistance ( float  distance)
inline

the cam should tell the frustum the distance between far and near

Definition at line 287 of file SViewFrustum.h.

◆ setFrom()

void saga::scene::SViewFrustum::setFrom ( const glm::mat4 &  matrix)
inline

This constructor creates a view frustum based on a projection and/or view matrix.

This constructor creates a view frustum based on a projection and/or view matrix.

Definition at line 294 of file SViewFrustum.h.

◆ transform()

void saga::scene::SViewFrustum::transform ( const glm::mat4 &  mat)
inline

transforms the frustum by the matrix

Parameters
matMatrix by which the view frustum is transformed.

Definition at line 170 of file SViewFrustum.h.

Member Data Documentation

◆ boundingBox

core::aabbox3d<float> saga::scene::SViewFrustum::boundingBox

bounding box around the view frustum

Definition at line 123 of file SViewFrustum.h.

◆ cameraPosition

glm::vec3 saga::scene::SViewFrustum::cameraPosition

the position of the camera

Definition at line 113 of file SViewFrustum.h.

◆ planes

std::array<core::plane3d<float>, VIEW_FRUSTUM_PLANE_COUNT> saga::scene::SViewFrustum::planes

all planes enclosing the view frustum.

Definition at line 120 of file SViewFrustum.h.


The documentation for this struct was generated from the following file: