arsa  2.7
Public Types | Public Member Functions | Public Attributes | List of all members
irr::scene::SViewFrustum Struct Reference

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

#include <SViewFrustum.h>

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

 SViewFrustum ()
 Default Constructor. More...
 
 SViewFrustum (const SViewFrustum &other)
 Copy Constructor. More...
 
 SViewFrustum (const core::matrix4 &mat, bool zClipFromZero)
 This constructor creates a view frustum based on a projection and/or view matrix. More...
 
void setFrom (const core::matrix4 &mat, bool zClipFromZero)
 This constructor creates a view frustum based on a projection and/or view matrix. More...
 
void transform (const core::matrix4 &mat)
 transforms the frustum by the matrix More...
 
core::vector3df getFarLeftUp () const
 returns the point which is on the far left upper corner inside the the view frustum. More...
 
core::vector3df getFarLeftDown () const
 returns the point which is on the far left bottom corner inside the the view frustum. More...
 
core::vector3df getFarRightUp () const
 returns the point which is on the far right top corner inside the the view frustum. More...
 
core::vector3df getFarRightDown () const
 returns the point which is on the far right bottom corner inside the the view frustum. More...
 
core::vector3df getNearLeftUp () const
 returns the point which is on the near left upper corner inside the the view frustum. More...
 
core::vector3df getNearLeftDown () const
 returns the point which is on the near left bottom corner inside the the view frustum. More...
 
core::vector3df getNearRightUp () const
 returns the point which is on the near right top corner inside the the view frustum. More...
 
core::vector3df getNearRightDown () const
 returns the point which is on the near right bottom corner inside the the view frustum. More...
 
const core::aabbox3d< f32 > & 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...
 
core::vector3df 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...
 
core::matrix4getTransform (video::E_TRANSFORMATION_STATE state)
 get the given state's matrix based on frustum E_TRANSFORMATION_STATE More...
 
const core::matrix4getTransform (video::E_TRANSFORMATION_STATE state) const
 get the given state's matrix based on frustum E_TRANSFORMATION_STATE More...
 
bool clipLine (core::line3d< f32 > &line) const
 clips a line to the view frustum. More...
 

Public Attributes

core::vector3df cameraPosition
 the position of the camera More...
 
core::plane3d< f32planes [VF_PLANE_COUNT]
 all planes enclosing the view frustum. More...
 
core::aabbox3d< f32boundingBox
 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 25 of file SViewFrustum.h.

Member Enumeration Documentation

◆ VFPLANES

Enumerator
VF_FAR_PLANE 

Far plane of the frustum. That is the plane furthest 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.

28  {
30  VF_FAR_PLANE = 0,
41 
44  };
Left plane of the frustum.
Definition: SViewFrustum.h:34
Top plane of the frustum.
Definition: SViewFrustum.h:40
Right plane of the frustum.
Definition: SViewFrustum.h:36
Amount of planes enclosing the view frustum. Should be 6.
Definition: SViewFrustum.h:43
Near plane of the frustum. That is the plane nearest to the eye.
Definition: SViewFrustum.h:32
Far plane of the frustum. That is the plane furthest away from the eye.
Definition: SViewFrustum.h:30
Bottom plane of the frustum.
Definition: SViewFrustum.h:38

Constructor & Destructor Documentation

◆ SViewFrustum() [1/3]

irr::scene::SViewFrustum::SViewFrustum ( )
inline

Default Constructor.

Definition at line 48 of file SViewFrustum.h.

48 : BoundingRadius(0.f), FarNearDistance(0.f) {}
GLfloat f

◆ SViewFrustum() [2/3]

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

Copy Constructor.

Copy constructor ViewFrustum

Definition at line 147 of file SViewFrustum.h.

148  {
149  cameraPosition=other.cameraPosition;
150  boundingBox=other.boundingBox;
151 
152  u32 i;
153  for (i=0; i<VF_PLANE_COUNT; ++i)
154  planes[i]=other.planes[i];
155 
156  for (i=0; i<ETS_COUNT_FRUSTUM; ++i)
157  Matrices[i]=other.Matrices[i];
158 
159  BoundingRadius = other.BoundingRadius;
160  FarNearDistance = other.FarNearDistance;
161  BoundingCenter = other.BoundingCenter;
162  }
core::plane3d< f32 > planes[VF_PLANE_COUNT]
all planes enclosing the view frustum.
Definition: SViewFrustum.h:118
core::aabbox3d< f32 > boundingBox
bounding box around the view frustum
Definition: SViewFrustum.h:121
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
Amount of planes enclosing the view frustum. Should be 6.
Definition: SViewFrustum.h:43
core::vector3df cameraPosition
the position of the camera
Definition: SViewFrustum.h:115

◆ SViewFrustum() [3/3]

irr::scene::SViewFrustum::SViewFrustum ( const core::matrix4 mat,
bool  zClipFromZero 
)
inline

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

Definition at line 164 of file SViewFrustum.h.

165  {
166  setFrom(mat, zClipFromZero);
167  }
void setFrom(const core::matrix4 &mat, bool zClipFromZero)
This constructor creates a view frustum based on a projection and/or view matrix.
Definition: SViewFrustum.h:297

Member Function Documentation

◆ clipLine()

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 397 of file SViewFrustum.h.

398  {
399  bool wasClipped = false;
400  for (u32 i=0; i < VF_PLANE_COUNT; ++i)
401  {
402  if (planes[i].classifyPointRelation(line.start) == core::ISREL3D_FRONT)
403  {
404  line.start = line.start.getInterpolated(line.end,
405  1.f-planes[i].getKnownIntersectionWithLine(line.start, line.end));
406  wasClipped = true;
407  }
408  if (planes[i].classifyPointRelation(line.end) == core::ISREL3D_FRONT)
409  {
410  line.end = line.start.getInterpolated(line.end,
411  1.f-planes[i].getKnownIntersectionWithLine(line.start, line.end));
412  wasClipped = true;
413  }
414  }
415  return wasClipped;
416  }
core::plane3d< f32 > planes[VF_PLANE_COUNT]
all planes enclosing the view frustum.
Definition: SViewFrustum.h:118
f32 getKnownIntersectionWithLine(const vector3d< T > &linePoint1, const vector3d< T > &linePoint2) const
Get percentage of line between two points where an intersection with this plane happens.
Definition: plane3d.h:107
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
Amount of planes enclosing the view frustum. Should be 6.
Definition: SViewFrustum.h:43

◆ getBoundingBox()

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

returns a bounding box enclosing the whole view frustum

Definition at line 260 of file SViewFrustum.h.

261  {
262  return boundingBox;
263  }
core::aabbox3d< f32 > boundingBox
bounding box around the view frustum
Definition: SViewFrustum.h:121

◆ getBoundingCenter()

core::vector3df irr::scene::SViewFrustum::getBoundingCenter ( ) const
inline

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

Definition at line 285 of file SViewFrustum.h.

286  {
287  return BoundingCenter;
288  }

◆ getBoundingRadius()

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

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

Definition at line 280 of file SViewFrustum.h.

281  {
282  return BoundingRadius;
283  }

◆ getFarLeftDown()

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 190 of file SViewFrustum.h.

191  {
196 
197  return p;
198  }
core::plane3d< f32 > planes[VF_PLANE_COUNT]
all planes enclosing the view frustum.
Definition: SViewFrustum.h:118
Left plane of the frustum.
Definition: SViewFrustum.h:34
GLfloat GLfloat p
bool getIntersectionWithPlanes(const plane3d< T > &o1, const plane3d< T > &o2, vector3d< T > &outPoint) const
Get the intersection point with two other planes if there is one.
Definition: plane3d.h:195
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition: vector3d.h:461
Far plane of the frustum. That is the plane furthest away from the eye.
Definition: SViewFrustum.h:30
Bottom plane of the frustum.
Definition: SViewFrustum.h:38

◆ getFarLeftUp()

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 180 of file SViewFrustum.h.

181  {
186 
187  return p;
188  }
core::plane3d< f32 > planes[VF_PLANE_COUNT]
all planes enclosing the view frustum.
Definition: SViewFrustum.h:118
Left plane of the frustum.
Definition: SViewFrustum.h:34
GLfloat GLfloat p
Top plane of the frustum.
Definition: SViewFrustum.h:40
bool getIntersectionWithPlanes(const plane3d< T > &o1, const plane3d< T > &o2, vector3d< T > &outPoint) const
Get the intersection point with two other planes if there is one.
Definition: plane3d.h:195
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition: vector3d.h:461
Far plane of the frustum. That is the plane furthest away from the eye.
Definition: SViewFrustum.h:30

◆ getFarRightDown()

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 210 of file SViewFrustum.h.

211  {
216 
217  return p;
218  }
core::plane3d< f32 > planes[VF_PLANE_COUNT]
all planes enclosing the view frustum.
Definition: SViewFrustum.h:118
GLfloat GLfloat p
bool getIntersectionWithPlanes(const plane3d< T > &o1, const plane3d< T > &o2, vector3d< T > &outPoint) const
Get the intersection point with two other planes if there is one.
Definition: plane3d.h:195
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition: vector3d.h:461
Right plane of the frustum.
Definition: SViewFrustum.h:36
Far plane of the frustum. That is the plane furthest away from the eye.
Definition: SViewFrustum.h:30
Bottom plane of the frustum.
Definition: SViewFrustum.h:38

◆ getFarRightUp()

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 200 of file SViewFrustum.h.

201  {
206 
207  return p;
208  }
core::plane3d< f32 > planes[VF_PLANE_COUNT]
all planes enclosing the view frustum.
Definition: SViewFrustum.h:118
GLfloat GLfloat p
Top plane of the frustum.
Definition: SViewFrustum.h:40
bool getIntersectionWithPlanes(const plane3d< T > &o1, const plane3d< T > &o2, vector3d< T > &outPoint) const
Get the intersection point with two other planes if there is one.
Definition: plane3d.h:195
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition: vector3d.h:461
Right plane of the frustum.
Definition: SViewFrustum.h:36
Far plane of the frustum. That is the plane furthest away from the eye.
Definition: SViewFrustum.h:30

◆ getNearLeftDown()

core::vector3df irr::scene::SViewFrustum::getNearLeftDown ( ) const
inline

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

Definition at line 230 of file SViewFrustum.h.

231  {
236 
237  return p;
238  }
core::plane3d< f32 > planes[VF_PLANE_COUNT]
all planes enclosing the view frustum.
Definition: SViewFrustum.h:118
Left plane of the frustum.
Definition: SViewFrustum.h:34
GLfloat GLfloat p
bool getIntersectionWithPlanes(const plane3d< T > &o1, const plane3d< T > &o2, vector3d< T > &outPoint) const
Get the intersection point with two other planes if there is one.
Definition: plane3d.h:195
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition: vector3d.h:461
Near plane of the frustum. That is the plane nearest to the eye.
Definition: SViewFrustum.h:32
Bottom plane of the frustum.
Definition: SViewFrustum.h:38

◆ getNearLeftUp()

core::vector3df irr::scene::SViewFrustum::getNearLeftUp ( ) const
inline

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

Definition at line 220 of file SViewFrustum.h.

221  {
226 
227  return p;
228  }
core::plane3d< f32 > planes[VF_PLANE_COUNT]
all planes enclosing the view frustum.
Definition: SViewFrustum.h:118
Left plane of the frustum.
Definition: SViewFrustum.h:34
GLfloat GLfloat p
Top plane of the frustum.
Definition: SViewFrustum.h:40
bool getIntersectionWithPlanes(const plane3d< T > &o1, const plane3d< T > &o2, vector3d< T > &outPoint) const
Get the intersection point with two other planes if there is one.
Definition: plane3d.h:195
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition: vector3d.h:461
Near plane of the frustum. That is the plane nearest to the eye.
Definition: SViewFrustum.h:32

◆ getNearRightDown()

core::vector3df irr::scene::SViewFrustum::getNearRightDown ( ) const
inline

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

Definition at line 250 of file SViewFrustum.h.

251  {
256 
257  return p;
258  }
core::plane3d< f32 > planes[VF_PLANE_COUNT]
all planes enclosing the view frustum.
Definition: SViewFrustum.h:118
GLfloat GLfloat p
bool getIntersectionWithPlanes(const plane3d< T > &o1, const plane3d< T > &o2, vector3d< T > &outPoint) const
Get the intersection point with two other planes if there is one.
Definition: plane3d.h:195
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition: vector3d.h:461
Right plane of the frustum.
Definition: SViewFrustum.h:36
Near plane of the frustum. That is the plane nearest to the eye.
Definition: SViewFrustum.h:32
Bottom plane of the frustum.
Definition: SViewFrustum.h:38

◆ getNearRightUp()

core::vector3df irr::scene::SViewFrustum::getNearRightUp ( ) const
inline

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

Definition at line 240 of file SViewFrustum.h.

241  {
246 
247  return p;
248  }
core::plane3d< f32 > planes[VF_PLANE_COUNT]
all planes enclosing the view frustum.
Definition: SViewFrustum.h:118
GLfloat GLfloat p
Top plane of the frustum.
Definition: SViewFrustum.h:40
bool getIntersectionWithPlanes(const plane3d< T > &o1, const plane3d< T > &o2, vector3d< T > &outPoint) const
Get the intersection point with two other planes if there is one.
Definition: plane3d.h:195
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition: vector3d.h:461
Right plane of the frustum.
Definition: SViewFrustum.h:36
Near plane of the frustum. That is the plane nearest to the eye.
Definition: SViewFrustum.h:32

◆ getTransform() [1/2]

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 363 of file SViewFrustum.h.

364  {
365  u32 index = 0;
366  switch ( state )
367  {
370  case video::ETS_VIEW:
371  index = SViewFrustum::ETS_VIEW; break;
372  default:
373  break;
374  }
375  return Matrices [ index ];
376  }
Projection transformation.
Definition: IVideoDriver.h:60
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
GLuint index
View transformation.
Definition: IVideoDriver.h:56

◆ getTransform() [2/2]

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 381 of file SViewFrustum.h.

382  {
383  u32 index = 0;
384  switch ( state )
385  {
388  case video::ETS_VIEW:
389  index = SViewFrustum::ETS_VIEW; break;
390  default:
391  break;
392  }
393  return Matrices [ index ];
394  }
Projection transformation.
Definition: IVideoDriver.h:60
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
GLuint index
View transformation.
Definition: IVideoDriver.h:56

◆ recalculateBoundingBox()

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

recalculates the bounding box and sphere based on the planes

Definition at line 265 of file SViewFrustum.h.

266  {
275 
276  // Also recalculate the bounding sphere when the bbox changes
277  recalculateBoundingSphere();
278  }
core::vector3df getNearLeftUp() const
returns the point which is on the near left upper corner inside the the view frustum.
Definition: SViewFrustum.h:220
core::vector3df getFarLeftDown() const
returns the point which is on the far left bottom corner inside the the view frustum.
Definition: SViewFrustum.h:190
core::vector3df getNearRightUp() const
returns the point which is on the near right top corner inside the the view frustum.
Definition: SViewFrustum.h:240
core::vector3df getFarLeftUp() const
returns the point which is on the far left upper corner inside the the view frustum.
Definition: SViewFrustum.h:180
void reset(T x, T y, T z)
Resets the bounding box to a one-point box.
Definition: aabbox3d.h:50
core::vector3df getFarRightDown() const
returns the point which is on the far right bottom corner inside the the view frustum.
Definition: SViewFrustum.h:210
core::aabbox3d< f32 > boundingBox
bounding box around the view frustum
Definition: SViewFrustum.h:121
core::vector3df getFarRightUp() const
returns the point which is on the far right top corner inside the the view frustum.
Definition: SViewFrustum.h:200
core::vector3df getNearRightDown() const
returns the point which is on the near right bottom corner inside the the view frustum.
Definition: SViewFrustum.h:250
void addInternalPoint(const vector3d< T > &p)
Adds a point to the bounding box.
Definition: aabbox3d.h:74
core::vector3df getNearLeftDown() const
returns the point which is on the near left bottom corner inside the the view frustum.
Definition: SViewFrustum.h:230

◆ setFarNearDistance()

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

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

Definition at line 290 of file SViewFrustum.h.

291  {
292  FarNearDistance = distance;
293  }
GLsizei GLsizei GLfloat distance

◆ setFrom()

void irr::scene::SViewFrustum::setFrom ( const core::matrix4 mat,
bool  zClipFromZero 
)
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 297 of file SViewFrustum.h.

298  {
299  // left clipping plane
300  planes[VF_LEFT_PLANE].Normal.X = mat[3 ] + mat[0];
301  planes[VF_LEFT_PLANE].Normal.Y = mat[7 ] + mat[4];
302  planes[VF_LEFT_PLANE].Normal.Z = mat[11] + mat[8];
303  planes[VF_LEFT_PLANE].D = mat[15] + mat[12];
304 
305  // right clipping plane
306  planes[VF_RIGHT_PLANE].Normal.X = mat[3 ] - mat[0];
307  planes[VF_RIGHT_PLANE].Normal.Y = mat[7 ] - mat[4];
308  planes[VF_RIGHT_PLANE].Normal.Z = mat[11] - mat[8];
309  planes[VF_RIGHT_PLANE].D = mat[15] - mat[12];
310 
311  // top clipping plane
312  planes[VF_TOP_PLANE].Normal.X = mat[3 ] - mat[1];
313  planes[VF_TOP_PLANE].Normal.Y = mat[7 ] - mat[5];
314  planes[VF_TOP_PLANE].Normal.Z = mat[11] - mat[9];
315  planes[VF_TOP_PLANE].D = mat[15] - mat[13];
316 
317  // bottom clipping plane
318  planes[VF_BOTTOM_PLANE].Normal.X = mat[3 ] + mat[1];
319  planes[VF_BOTTOM_PLANE].Normal.Y = mat[7 ] + mat[5];
320  planes[VF_BOTTOM_PLANE].Normal.Z = mat[11] + mat[9];
321  planes[VF_BOTTOM_PLANE].D = mat[15] + mat[13];
322 
323  // far clipping plane
324  planes[VF_FAR_PLANE].Normal.X = mat[3 ] - mat[2];
325  planes[VF_FAR_PLANE].Normal.Y = mat[7 ] - mat[6];
326  planes[VF_FAR_PLANE].Normal.Z = mat[11] - mat[10];
327  planes[VF_FAR_PLANE].D = mat[15] - mat[14];
328 
329  // near clipping plane
330  if ( zClipFromZero )
331  {
332  planes[VF_NEAR_PLANE].Normal.X = mat[2];
333  planes[VF_NEAR_PLANE].Normal.Y = mat[6];
334  planes[VF_NEAR_PLANE].Normal.Z = mat[10];
335  planes[VF_NEAR_PLANE].D = mat[14];
336  }
337  else
338  {
339  // near clipping plane
340  planes[VF_NEAR_PLANE].Normal.X = mat[3 ] + mat[2];
341  planes[VF_NEAR_PLANE].Normal.Y = mat[7 ] + mat[6];
342  planes[VF_NEAR_PLANE].Normal.Z = mat[11] + mat[10];
343  planes[VF_NEAR_PLANE].D = mat[15] + mat[14];
344  }
345 
346  // normalize normals
347  u32 i;
348  for ( i=0; i != VF_PLANE_COUNT; ++i)
349  {
351  planes[i].Normal.getLengthSQ());
352  planes[i].Normal *= len;
353  planes[i].D *= len;
354  }
355 
356  // make bounding box
358  }
T D
Distance from origin.
Definition: plane3d.h:231
T Y
Y coordinate of the vector.
Definition: vector3d.h:427
core::plane3d< f32 > planes[VF_PLANE_COUNT]
all planes enclosing the view frustum.
Definition: SViewFrustum.h:118
float f32
32 bit floating point variable.
Definition: irrTypes.h:108
vector3d< T > Normal
Normal vector of the plane.
Definition: plane3d.h:228
Left plane of the frustum.
Definition: SViewFrustum.h:34
T X
X coordinate of the vector.
Definition: vector3d.h:424
Top plane of the frustum.
Definition: SViewFrustum.h:40
GLenum GLsizei len
Right plane of the frustum.
Definition: SViewFrustum.h:36
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
Amount of planes enclosing the view frustum. Should be 6.
Definition: SViewFrustum.h:43
Near plane of the frustum. That is the plane nearest to the eye.
Definition: SViewFrustum.h:32
T Z
Z coordinate of the vector.
Definition: vector3d.h:430
Far plane of the frustum. That is the plane furthest away from the eye.
Definition: SViewFrustum.h:30
void recalculateBoundingBox()
recalculates the bounding box and sphere based on the planes
Definition: SViewFrustum.h:265
REALINLINE f64 reciprocal_squareroot(const f64 x)
Definition: irrMath.h:521
Bottom plane of the frustum.
Definition: SViewFrustum.h:38

◆ transform()

void irr::scene::SViewFrustum::transform ( const core::matrix4 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.

171  {
172  for (u32 i=0; i<VF_PLANE_COUNT; ++i)
173  mat.transformPlane(planes[i]);
174 
175  mat.transformVect(cameraPosition);
177  }
core::plane3d< f32 > planes[VF_PLANE_COUNT]
all planes enclosing the view frustum.
Definition: SViewFrustum.h:118
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
Amount of planes enclosing the view frustum. Should be 6.
Definition: SViewFrustum.h:43
core::vector3df cameraPosition
the position of the camera
Definition: SViewFrustum.h:115
void recalculateBoundingBox()
recalculates the bounding box and sphere based on the planes
Definition: SViewFrustum.h:265

Member Data Documentation

◆ boundingBox

core::aabbox3d<f32> irr::scene::SViewFrustum::boundingBox

bounding box around the view frustum

Definition at line 121 of file SViewFrustum.h.

◆ cameraPosition

core::vector3df irr::scene::SViewFrustum::cameraPosition

the position of the camera

Definition at line 115 of file SViewFrustum.h.

◆ planes

core::plane3d<f32> irr::scene::SViewFrustum::planes[VF_PLANE_COUNT]

all planes enclosing the view frustum.

Definition at line 118 of file SViewFrustum.h.


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