Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials

irr::scene::SViewFrustum Struct Reference

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

#include <SViewFrustum.h>

List of all members.

Public Types

enum  VFPLANES {
  VF_FAR_PLANE = 0, VF_NEAR_PLANE, VF_LEFT_PLANE, VF_RIGHT_PLANE,
  VF_BOTTOM_PLANE, VF_TOP_PLANE, VF_PLANE_COUNT
}

Public Member Functions

bool clipLine (core::line3d< f32 > &line) const
 clips a line to the view frustum.
const core::aabbox3d< f32 > & getBoundingBox () const
 returns a bounding box enclosing the whole view frustum
core::vector3df getFarLeftDown () const
 returns the point which is on the far left bottom corner inside the the view frustum.
core::vector3df getFarLeftUp () const
 returns the point which is on the far left upper corner inside the the view frustum.
core::vector3df getFarRightDown () const
 returns the point which is on the far right bottom corner inside the the view frustum.
core::vector3df getFarRightUp () const
 returns the point which is on the far right top corner inside the the view frustum.
const core::matrix4getTransform (video::E_TRANSFORMATION_STATE state) const
 get the given state's matrix based on frustum E_TRANSFORMATION_STATE
core::matrix4getTransform (video::E_TRANSFORMATION_STATE state)
 get the given state's matrix based on frustum E_TRANSFORMATION_STATE
void recalculateBoundingBox ()
 recalculates the bounding box member based on the planes
void setFrom (const core::matrix4 &mat)
 This constructor creates a view frustum based on a projection and/or view matrix.
 SViewFrustum (const core::matrix4 &mat)
 This constructor creates a view frustum based on a projection and/or view matrix.
 SViewFrustum (const SViewFrustum &other)
 Copy Constructor.
 SViewFrustum ()
 Default Constructor.
void transform (const core::matrix4 &mat)
 transforms the frustum by the matrix

Public Attributes

core::aabbox3d< f32boundingBox
 bounding box around the view frustum
core::vector3df cameraPosition
 the position of the camera
core::plane3d< f32planes [VF_PLANE_COUNT]
 all planes enclosing the view frustum.

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 four points. A bounding box around these four points is also stored in this structure.

Definition at line 25 of file SViewFrustum.h.


Member Enumeration Documentation

Enumerator:
VF_FAR_PLANE 

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

VF_NEAR_PLANE 

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

VF_LEFT_PLANE 

Left plane of the frustum.

VF_RIGHT_PLANE 

Right plane of the frustum.

VF_BOTTOM_PLANE 

Bottom plane of the frustum.

VF_TOP_PLANE 

Top plane of the frustum.

VF_PLANE_COUNT 

Amount of planes enclosing the view frustum. Should be 6.

Definition at line 27 of file SViewFrustum.h.


Constructor & Destructor Documentation

irr::scene::SViewFrustum::SViewFrustum (  )  [inline]

Default Constructor.

Definition at line 48 of file SViewFrustum.h.

irr::scene::SViewFrustum::SViewFrustum ( const SViewFrustum other  )  [inline]

Copy Constructor.

Copy constructor ViewFrustum

Definition at line 117 of file SViewFrustum.h.

References boundingBox, cameraPosition, planes, and VF_PLANE_COUNT.

irr::scene::SViewFrustum::SViewFrustum ( const core::matrix4 mat  )  [inline]

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

Definition at line 130 of file SViewFrustum.h.

References setFrom().


Member Function Documentation

bool irr::scene::SViewFrustum::clipLine ( core::line3d< f32 > &  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 292 of file SViewFrustum.h.

References irr::core::line3d< T >::end, irr::core::plane3d< T >::getKnownIntersectionWithLine(), irr::core::ISREL3D_FRONT, planes, irr::core::line3d< T >::start, and VF_PLANE_COUNT.

const core::aabbox3d< f32 > & irr::scene::SViewFrustum::getBoundingBox (  )  const [inline]

returns a bounding box enclosing the whole view frustum

Definition at line 186 of file SViewFrustum.h.

References boundingBox.

core::vector3df irr::scene::SViewFrustum::getFarLeftDown (  )  const [inline]

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

Definition at line 156 of file SViewFrustum.h.

References irr::core::plane3d< T >::getIntersectionWithPlanes(), planes, VF_BOTTOM_PLANE, VF_FAR_PLANE, and VF_LEFT_PLANE.

Referenced by recalculateBoundingBox().

core::vector3df irr::scene::SViewFrustum::getFarLeftUp (  )  const [inline]

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

Definition at line 146 of file SViewFrustum.h.

References irr::core::plane3d< T >::getIntersectionWithPlanes(), planes, VF_FAR_PLANE, VF_LEFT_PLANE, and VF_TOP_PLANE.

Referenced by recalculateBoundingBox().

core::vector3df irr::scene::SViewFrustum::getFarRightDown (  )  const [inline]

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

Definition at line 176 of file SViewFrustum.h.

References irr::core::plane3d< T >::getIntersectionWithPlanes(), planes, VF_BOTTOM_PLANE, VF_FAR_PLANE, and VF_RIGHT_PLANE.

Referenced by recalculateBoundingBox().

core::vector3df irr::scene::SViewFrustum::getFarRightUp (  )  const [inline]

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

Definition at line 166 of file SViewFrustum.h.

References irr::core::plane3d< T >::getIntersectionWithPlanes(), planes, VF_FAR_PLANE, VF_RIGHT_PLANE, and VF_TOP_PLANE.

Referenced by recalculateBoundingBox().

const core::matrix4 & irr::scene::SViewFrustum::getTransform ( video::E_TRANSFORMATION_STATE  state  )  const [inline]

get the given state's matrix based on frustum E_TRANSFORMATION_STATE

View Frustum depends on Projection & View Matrix

Definition at line 276 of file SViewFrustum.h.

References irr::video::ETS_PROJECTION, and irr::video::ETS_VIEW.

core::matrix4 & irr::scene::SViewFrustum::getTransform ( video::E_TRANSFORMATION_STATE  state  )  [inline]

get the given state's matrix based on frustum E_TRANSFORMATION_STATE

View Frustum depends on Projection & View Matrix

Definition at line 258 of file SViewFrustum.h.

References irr::video::ETS_PROJECTION, and irr::video::ETS_VIEW.

void irr::scene::SViewFrustum::recalculateBoundingBox (  )  [inline]

recalculates the bounding box member based on the planes

Definition at line 191 of file SViewFrustum.h.

References irr::core::aabbox3d< T >::addInternalPoint(), boundingBox, cameraPosition, getFarLeftDown(), getFarLeftUp(), getFarRightDown(), getFarRightUp(), and irr::core::aabbox3d< T >::reset().

Referenced by setFrom(), and transform().

void irr::scene::SViewFrustum::setFrom ( const core::matrix4 mat  )  [inline]

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

Definition at line 203 of file SViewFrustum.h.

References irr::core::plane3d< T >::D, irr::core::plane3d< T >::Normal, planes, recalculateBoundingBox(), irr::core::reciprocal_squareroot(), VF_BOTTOM_PLANE, VF_FAR_PLANE, VF_LEFT_PLANE, VF_NEAR_PLANE, VF_PLANE_COUNT, VF_RIGHT_PLANE, and VF_TOP_PLANE.

Referenced by SViewFrustum().

void irr::scene::SViewFrustum::transform ( const core::matrix4 mat  )  [inline]

transforms the frustum by the matrix

Parameters:
mat,: Matrix by which the view frustum is transformed.

Definition at line 136 of file SViewFrustum.h.

References cameraPosition, planes, recalculateBoundingBox(), irr::core::CMatrix4< T >::transformPlane(), irr::core::CMatrix4< T >::transformVect(), and VF_PLANE_COUNT.


Member Data Documentation

bounding box around the view frustum

Definition at line 98 of file SViewFrustum.h.

Referenced by getBoundingBox(), recalculateBoundingBox(), and SViewFrustum().

the position of the camera

Definition at line 92 of file SViewFrustum.h.

Referenced by recalculateBoundingBox(), SViewFrustum(), and transform().

all planes enclosing the view frustum.

Definition at line 95 of file SViewFrustum.h.

Referenced by clipLine(), getFarLeftDown(), getFarLeftUp(), getFarRightDown(), getFarRightUp(), setFrom(), SViewFrustum(), and transform().


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

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Sun Oct 24 12:42:09 2010 by Doxygen (1.6.2)