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. ...
core::vector3df getNearLeftUp() const
returns the point which is on the near left upper corner inside the the view frustum.
T Y
Y coordinate of the vector.
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.
float f32
32 bit floating point variable.
vector3d< T > getInterpolated(const vector3d< T > &other, f64 d) const
Creates an interpolated vector between this vector and another vector.
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.
void transformPlane(core::plane3d< f32 > &plane) const
Transforms a plane by this matrix.
const core::aabbox3d< f32 > & getBoundingBox() const
returns a bounding box enclosing the whole view frustum
vector3d< T > Normal
Normal vector of the plane.
core::vector3df getFarLeftDown() const
returns the point which is on the far left bottom corner inside the the view frustum.
Left plane of the frustum.
T X
X coordinate of the vector.
core::vector3df getNearRightUp() const
returns the point which is on the near right top 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.
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.
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.
Projection transformation.
core::vector3df getFarRightDown() const
returns the point which is on the far right bottom corner inside the the view frustum.
core::aabbox3d< f32 > boundingBox
bounding box around the view frustum
Right plane of the frustum.
core::vector3df getFarRightUp() const
returns the point which is on the far right top corner inside the the view frustum.
E_TRANSFORMATION_STATE
enumeration for geometry transformation states
bool clipLine(core::line3d< f32 > &line) const
clips a line to the view frustum.
vector3d< T > end
End point of line.
unsigned int u32
32 bit unsigned variable.
Amount of planes enclosing the view frustum. Should be 6.
void transformVect(vector3df &vect) const
Transforms the vector by this matrix.
core::vector3df cameraPosition
the position of the camera
core::vector3df getNearRightDown() const
returns the point which is on the near right bottom corner inside the the view frustum.
SViewFrustum()
Default Constructor.
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::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.
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
core::vector3df getNearLeftDown() const
returns the point which is on the near left bottom corner inside the the view frustum.
REALINLINE f64 reciprocal_squareroot(const f64 x)
Bottom plane of the frustum.