5#ifndef __S_VIEW_FRUSTUM_H_INCLUDED__
6#define __S_VIEW_FRUSTUM_H_INCLUDED__
114 enum E_TRANSFORMATION_STATE_FRUSTUM
138 for (i=0; i<ETS_COUNT_FRUSTUM; ++i)
139 Matrices[i]=other.Matrices[i];
298 planes[i].Normal.getLengthSQ());
316 index = SViewFrustum::ETS_PROJECTION;
break;
318 index = SViewFrustum::ETS_VIEW;
break;
322 return Matrices [ index ];
334 index = SViewFrustum::ETS_PROJECTION;
break;
336 index = SViewFrustum::ETS_VIEW;
break;
340 return Matrices [ index ];
346 bool wasClipped =
false;
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
void transformVect(vector3df &vect) const
Transforms the vector by this matrix.
void transformPlane(core::plane3d< f32 > &plane) const
Transforms a plane by this matrix.
Axis aligned bounding box in 3d dimensional space.
aabbox3d< T > getInterpolated(const aabbox3d< T > &other, f32 d) const
Calculates a new interpolated bounding box.
void addInternalPoint(const vector3d< T > &p)
Adds a point to the bounding box.
void reset(T x, T y, T z)
Resets the bounding box to a one-point box.
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.
vector3d< T > Normal
Normal vector of the plane.
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.
T X
X coordinate of the vector.
T Z
Z coordinate of the vector.
T Y
Y coordinate of the vector.
REALINLINE f64 reciprocal_squareroot(const f64 x)
E_TRANSFORMATION_STATE
enumeration for geometry transformation states
@ ETS_VIEW
View transformation.
@ ETS_PROJECTION
Projection transformation.
Everything in the Irrlicht Engine can be found in this namespace.
float f32
32 bit floating point variable.
unsigned int u32
32 bit unsigned variable.
Defines the view frustum. That's the space visible by the camera.
const core::aabbox3d< f32 > & getBoundingBox() const
returns a bounding box enclosing the whole view frustum
void setFrom(const core::matrix4 &mat)
This constructor creates a view frustum based on a projection and/or view matrix.
core::vector3df getFarRightUp() const
returns the point which is on the far right top corner inside the the view frustum.
void recalculateBoundingBox()
recalculates the bounding box member based on the planes
core::vector3df getNearRightUp() const
returns the point which is on the near right top corner inside the the view frustum.
core::vector3df getNearRightDown() const
returns the point which is on the near right bottom corner inside the the view frustum.
SViewFrustum()
Default Constructor.
core::vector3df cameraPosition
the position of the camera
core::vector3df getFarLeftDown() const
returns the point which is on the far left bottom corner inside the the view frustum.
bool clipLine(core::line3d< f32 > &line) const
clips a line to 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::matrix4 & getTransform(video::E_TRANSFORMATION_STATE state)
get the given state's matrix based on frustum E_TRANSFORMATION_STATE
core::aabbox3d< f32 > boundingBox
bounding box around the view frustum
core::vector3df getNearLeftUp() const
returns the point which is on the near left upper corner inside the the view frustum.
@ VF_FAR_PLANE
Far plane of the frustum. That is the plane farest away from the eye.
@ VF_LEFT_PLANE
Left plane of the frustum.
@ VF_PLANE_COUNT
Amount of planes enclosing the view frustum. Should be 6.
@ VF_BOTTOM_PLANE
Bottom plane of the frustum.
@ VF_RIGHT_PLANE
Right plane of the frustum.
@ VF_NEAR_PLANE
Near plane of the frustum. That is the plane nearest to the eye.
@ VF_TOP_PLANE
Top plane of the frustum.
core::vector3df getNearLeftDown() const
returns the point which is on the near left bottom corner inside the the view frustum.
void transform(const core::matrix4 &mat)
transforms the frustum by the matrix
core::plane3d< f32 > planes[VF_PLANE_COUNT]
all planes enclosing the view frustum.