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;
void setFrom(const core::matrix4 &mat)
This constructor creates a view frustum based on a projection and/or view matrix. ...
T Y
Y coordinate of the vector.
void transform(const core::matrix4 &mat)
transforms the frustum by the matrix
core::vector3df getFarRightDown() const
returns the point which is on the far right bottom corner inside the the view frustum.
core::vector3df getNearLeftDown() const
returns the point which is on the near left bottom corner inside the the view frustum.
core::plane3d< f32 > planes[VF_PLANE_COUNT]
all planes enclosing the view frustum.
float f32
32 bit floating point variable.
void transformVect(vector3df &vect) const
Transforms the vector by this matrix.
vector3d< T > Normal
Normal vector of the plane.
Left plane of the frustum.
const core::aabbox3d< f32 > & getBoundingBox() const
returns a bounding box enclosing the whole view frustum
T X
X coordinate of the vector.
core::vector3df getFarLeftDown() const
returns the point which is on the far left bottom corner inside the the view frustum.
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.
Everything in the Irrlicht Engine can be found in this namespace.
Top plane of the frustum.
3D line between two points with intersection methods.
Defines the view frustum. That's the space visible by the camera.
void reset(T x, T y, T z)
Resets the bounding box to a one-point box.
Projection transformation.
vector3d< T > getInterpolated(const vector3d< T > &other, f64 d) const
Creates an interpolated vector between this vector and another vector.
core::aabbox3d< f32 > boundingBox
bounding box around the view frustum
Right plane of the frustum.
E_TRANSFORMATION_STATE
enumeration for geometry transformation states
vector3d< T > end
End point of line.
unsigned int u32
32 bit unsigned variable.
Amount of planes enclosing the view frustum. Should be 6.
core::vector3df cameraPosition
the position of the camera
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.
SViewFrustum()
Default Constructor.
core::vector3df getNearRightDown() const
returns the point which is on the near right 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.
Near plane of the frustum. That is the plane nearest to the eye.
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
vector3d< T > start
Start point of line.
void addInternalPoint(const vector3d< T > &p)
Adds a point to the bounding box.
core::vector3df getNearLeftUp() const
returns the point which is on the near left upper 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
T Z
Z coordinate of the vector.
core::vector3df getNearRightUp() const
returns the point which is on the near right top corner inside the the view frustum.
Far plane of the frustum. That is the plane farest away from the eye.
void recalculateBoundingBox()
recalculates the bounding box member based on the planes
bool clipLine(core::line3d< f32 > &line) const
clips a line to the view frustum.
void transformPlane(core::plane3d< f32 > &plane) const
Transforms a plane by this matrix.
core::vector3df getFarRightUp() const
returns the point which is on the far right top corner inside the the view frustum.
REALINLINE f64 reciprocal_squareroot(const f64 x)
Bottom plane of the frustum.