Unigine::BoundFrustum Class
Header: | #include <UnigineBounds.h> |
This class serves to construct the bounding frustum in single precision coordinates.
Instances of this class are deleted automatically when it is necessary.
In case of double precision coordinates, the bounding frustum should be constructed by using the WorldBoundFrustum class. It includes the same functions as the BoundFrustum class, but its functions deal with the double precision coordinates.
To support both single and double precision builds, you can use the WorldBoundFrustum class only. The engine will automatically substitute it with the BoundFrustum if it is required.
BoundFrustum Class
Members
BoundFrustum ( ) #
Constructor. Creates an empty bounding frustum.BoundFrustum ( const mat4 & projection, const mat4 & modelview ) #
Initialization by matrices.Arguments
- const mat4 & projection - A projection matrix.
- const mat4 & modelview - A modelview matrix.
BoundFrustum ( const BoundFrustum & bf ) #
Initialization by the bounding frustum.Arguments
- const BoundFrustum & bf - The bounding frustum.
BoundFrustum ( const BoundFrustum & bf, const mat4 & invtransform ) #
Initialization by the bounding frustum and transformation matrix.Arguments
- const BoundFrustum & bf - The bounding frustum.
- const mat4 & invtransform - The inverse transformation matrix.
void set ( const mat4 & projection, const mat4 & modelview ) #
Sets the bounding frustum by matrices.Arguments
- const mat4 & projection - A projection matrix.
- const mat4 & modelview - A modelview matrix.
void set ( const BoundFrustum & bf ) #
Sets the bounding frustum by the bounding frustum.Arguments
- const BoundFrustum & bf - The bounding frustum.
void set ( const BoundFrustum & bf, const mat4 & itransform ) #
Sets the bounding frustum by the bounding frustum and transformation matrix.Arguments
- const BoundFrustum & bf - The bounding frustum.
- const mat4 & itransform - The inverse transformation matrix.
const vec3 & getCamera ( ) #
Returns the position of the camera.Return value
Camera position.const vec4 * getPlanes ( ) # const
Returns the bounding frustum cliping planes array.Return value
The bounding frustum cliping planes array.int isValid ( ) # const
Checks the bounding frustum status.Return value
1 if the bounding frustum is valid.void clear ( ) #
Clears the bounding frustum.int inside ( const vec3 & point, float radius ) # const
Checks if the sphere is inside the bounding frustum.Arguments
- const vec3 & point - The coordinates of the center of the sphere.
- float radius - The sphere radius.
Return value
1 if the sphere is inside the bounding frustum; otherwise, 0.int inside ( const vec3 & min, const vec3 & max ) # const
Checks if the box is inside the bounding frustum.Arguments
- const vec3 & min - The box minimum coordinate.
- const vec3 & max - The box maximum coordinate.
Return value
1 if the box is inside the bounding frustum; otherwise, 0.int inside ( const BoundSphere & bs ) # const
Checks if the bounding sphere is inside the bounding frustum.Arguments
- const BoundSphere & bs - The bounding sphere.
Return value
1 if the bounding sphere is inside the bounding frustum; otherwise, 0.int inside ( const BoundBox & bb ) # const
Checks if the bounding box is inside the bounding frustum.Arguments
- const BoundBox & bb - The bounding box.
Return value
1 if the bounding box is inside the bounding frustum; otherwise, 0.int insideAll ( const BoundBox & bb ) #
Checks if the whole given bounding box is inside the current bounding frustum.Arguments
- const BoundBox & bb - Bounding box.
Return value
1 if the whole bounding box is inside the bounding frustum; otherwise, 0.int insideAll ( const BoundSphere & bs ) #
Checks if the whole given bounding sphere is inside the current bounding frustum.Arguments
- const BoundSphere & bs - Bounding sphere.
Return value
1 if the whole bounding sphere is inside the bounding frustum; otherwise, 0.BoundFrustum & operator= ( const BoundFrustum & bf ) #
Assignment operator.Arguments
- const BoundFrustum & bf - The bounding frustum.
Return value
Bounding frustum.int operator== ( const BoundFrustum & bf ) #
Bounding frustum equal comparison operator.Arguments
- const BoundFrustum & bf - The bounding frustum to compare with.
Return value
1 if the current bounding frustum is equal to the given one; otherwise, 0.int operator!= ( const BoundFrustum & bf ) #
Bounding frustum not equal comparison operator.Arguments
- const BoundFrustum & bf - The bounding frustum to compare with.
Return value
1 if the current bounding frustum is not equal to the given one; otherwise, 0.void setITransform ( const mat4 & itransform ) #
Sets the transformation matrix by an inverse transformation matrix.Arguments
- const mat4 & itransform - The inverse transformation matrix.
void setITransform ( const dmat4 & itransform ) #
Sets the transformation matrix by an inverse transformation matrix.Arguments
- const dmat4 & itransform - The inverse transformation matrix.
int compare ( const BoundFrustum & bf ) #
Compares the current bounding frustum with the given one.Arguments
- const BoundFrustum & bf - Bounding frustum.
Return value
1 if the current bounding frustum is equal to the given one; otherwise, 0.int addPortal ( const vec3 * points, int num_points, const mat4 & transform ) #
Adds a new portal created from a set of points to the current bounding frustum.Arguments
- const vec3 * points - The vector of points.
- int num_points - The number of points, must be equal to 4.
- const mat4 & transform - The transformation matrix.
Return value
1 if the portal was successfully added; otherwise, 0.void removePortal ( ) #
Removes the last portal from the current bounding frustum.int getNumPortals ( ) #
Returns the number of portals of the current bounding frustum.Return value
Number of portals.const vec3 * getPortalPoints ( int num ) #
Returns the vector containing the points of the given portal of the current bounding frustum.Arguments
- int num - Index of the portal, in the [0, number of portal] range.
Return value
Vector of portal points.void expand ( float radius ) #
Expands the current bounding frustum by the given radius.Arguments
- float radius - Radius.
int inside ( const vec3 & point ) #
Checks if the point is inside the bounding frustum.Arguments
- const vec3 & point - Point.
Return value
1 if the point is inside the bounding frustum; otherwise, 0.int inside ( const vec3 * points, int num ) #
Checks if a set of points is inside the bounding frustum.Arguments
- const vec3 * points - Vector of points.
- int num - Number of points.
Return value
1 if the points are inside the bounding frustum; otherwise, 0.int insideFast ( const vec3 & point ) #
Performs a fast check if the point is inside the bounding frustum.Arguments
- const vec3 & point - Point.
Return value
1 if the point is inside the bounding frustum; otherwise, 0.int insideFast ( const vec3 & point, float radius ) #
Performs a fast check if the sphere is inside the bounding frustum.Arguments
- const vec3 & point - Center point.
- float radius - Radius.
Return value
1 if the sphere is inside the bounding frustum; otherwise, 0.int insideFast ( const vec3 & min, const vec3 & max ) #
Performs a fast check if the box is inside the bounding frustum.Arguments
- const vec3 & min - Minimum point.
- const vec3 & max - Maximum point.
Return value
1 if the box is inside the bounding frustum; otherwise, 0.int insideFast ( const vec3 * points, int num ) #
Performs a fast check if the set of points is inside the bounding frustum.Arguments
- const vec3 * points - Vector of points.
- int num - Number of points.
Return value
1 if the point is inside the bounding frustum; otherwise, 0.int inside ( const BoundFrustum & bf ) #
Checks if the given bounding frustum is inside the current bounding frustum.Arguments
- const BoundFrustum & bf - The bounding frustum.
Return value
1 if the given bounding frustum is inside the bounding frustum; otherwise, 0.int insideValid ( const BoundSphere & bs ) #
Checks if the given bounding sphere is inside the bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundSphere & bs - The bounding sphere.
Return value
1 if the given bounding sphere is inside the bounding frustum; otherwise, 0.int insideValid ( const BoundBox & bb ) #
Checks if the given bounding box is inside the bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundBox & bb - The bounding box.
Return value
1 if the given bounding box is inside the bounding frustum; otherwise, 0.int insideValid ( const BoundFrustum & bf ) #
Checks if the given bounding frustum is inside the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundFrustum & bf - The bounding frustum.
Return value
1 if the given bounding frustum is inside the bounding frustum; otherwise, 0.int insideValidFast ( const BoundSphere & bs ) #
Performs a fast check if the given bounding sphere is inside the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundSphere & bs - The bounding sphere.
Return value
1 if the given bounding sphere is inside the bounding frustum; otherwise, 0.int insideValidFast ( const BoundBox & bb ) #
Performs a fast check if the given bounding box is inside the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundBox & bb - The bounding box.
Return value
1 if the given bounding box is inside the bounding frustum; otherwise, 0.int insideValidFast ( const BoundFrustum & bf ) #
Performs a fast check if the given bounding frustum is inside the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundFrustum & bf - The bounding frustum.
Return value
1 if the given bounding frustum is inside the bounding frustum; otherwise, 0.int insideAll ( const BoundFrustum & bf ) #
Checks if the whole given bounding frustum is inside the current bounding frustum.Arguments
- const BoundFrustum & bf - The bounding frustum.
Return value
1 if the given bounding frustum is inside the bounding frustum; otherwise, 0.int insideAllValid ( const BoundSphere & bs ) #
Checks if the whole given bounding sphere is inside the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundSphere & bs - The bounding sphere.
Return value
1 if the given bounding sphere is inside the bounding frustum; otherwise, 0.int insideAllValid ( const BoundBox & bb ) #
Checks if the whole given bounding box is inside the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundBox & bb - The bounding box.
Return value
1 if the given bounding box is inside the bounding frustum; otherwise, 0.int insideAllValid ( const BoundFrustum & bf ) #
Checks if the whole given bounding frustum is inside the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundFrustum & bf - The bounding frustum.
Return value
1 if the given bounding frustum is inside the bounding frustum; otherwise, 0.int insideAllValidFast ( const BoundSphere & bs ) #
Performs a fast check if the whole given bounding sphere is inside the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundSphere & bs - The bounding sphere.
Return value
1 if the given bounding sphere is inside the bounding frustum; otherwise, 0.int insideAllValidFast ( const BoundBox & bb ) #
Performs a fast check if the whole given bounding box is inside the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundBox & bb - The bounding box.
Return value
1 if the given bounding box is inside the bounding frustum; otherwise, 0.int insideAllValidFast ( const BoundFrustum & bf ) #
Performs a fast check if the whole given bounding frustum is inside the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundFrustum & bf - The bounding frustum.
Return value
1 if the given bounding frustum is inside the bounding frustum; otherwise, 0.int insidePlanes ( const BoundSphere & bs ) #
Checks if the given bounding sphere is inside the volume defined by the planes of the current bounding frustum.Arguments
- const BoundSphere & bs - The bounding sphere.
Return value
1 if the given bounding sphere is inside the volume; otherwise, 0.int insidePlanes ( const BoundBox & bb ) #
Checks if the given bounding box is inside the volume defined by the planes of the current bounding frustum.Arguments
- const BoundBox & bb - The bounding box.
Return value
1 if the given bounding box is inside the volume; otherwise, 0.int insidePlanes ( const BoundFrustum & bf ) #
Checks if the given bounding frustum is inside the volume defined by the planes of the current bounding frustum.Arguments
- const BoundFrustum & bf - The bounding frustum.
Return value
1 if the given bounding frustum is inside the volume; otherwise, 0.int insidePlanesValid ( const BoundSphere & bs ) #
Checks if the given bounding sphere is inside the volume defined by the planes of the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundSphere & bs - The bounding sphere.
Return value
1 if the given bounding sphere is inside the volume; otherwise, 0.int insidePlanesValid ( const BoundBox & bb ) #
Checks if the given bounding box is inside the volume defined by the planes of the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundBox & bb - The bounding box.
Return value
1 if the given bounding box is inside the volume; otherwise, 0.int insidePlanesValid ( const BoundFrustum & bf ) #
Checks if the given bounding frustum is inside the volume defined by the planes of the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundFrustum & bf - The bounding frustum.
Return value
1 if the given bounding frustum is inside the volume; otherwise, 0.int insidePlanesValidFast ( const BoundSphere & bs ) #
Performs a fast check if the given bounding sphere is inside the volume defined by the planes of the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundSphere & bs - The bounding sphere.
Return value
1 if the given bounding sphere is inside the volume; otherwise, 0.int insidePlanesValidFast ( const BoundBox & bb ) #
Performs a fast check if the given bounding box is inside the volume defined by the planes of the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundBox & bb - The bounding box.
Return value
1 if the given bounding box is inside the volume; otherwise, 0.int insidePlanesValidFast ( const BoundFrustum & bf ) #
Performs a fast check if the given bounding frustum is inside the volume defined by the planes of the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundFrustum & bf - The bounding frustum.
Return value
1 if the given bounding frustum is inside the volume; otherwise, 0.int insidePortals ( const BoundSphere & bs ) #
Checks if the given bounding sphere is inside the portals of the current bounding frustum.Arguments
- const BoundSphere & bs - The bounding sphere.
Return value
1 if the given bounding sphere is inside the portals; otherwise, 0.int insidePortals ( const BoundBox & bb ) #
Checks if the given bounding box is inside the portals of the current bounding frustum.Arguments
- const BoundBox & bb - The bounding box.
Return value
1 if the given bounding box is inside the portals; otherwise, 0.int insidePortals ( const BoundFrustum & bf ) #
Checks if the given bounding frustum is inside the portals of the current bounding frustum.Arguments
- const BoundFrustum & bf - The bounding frustum.
Return value
1 if the given bounding frustum is inside the portals; otherwise, 0.int insidePortalsValid ( const BoundSphere & bs ) #
Checks if the given bounding sphere is inside the portals of the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundSphere & bs
Return value
1 if the given bounding sphere is inside the portals; otherwise, 0.int insidePortalsValid ( const BoundBox & bb ) #
Checks if the given bounding box is inside the portals of the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundBox & bb
Return value
1 if the given bounding box is inside the portals; otherwise, 0.int insidePortalsValid ( const BoundFrustum & bf ) #
Checks if the given bounding frustum is inside the portals of the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundFrustum & bf
Return value
1 if the given bounding frustum is inside the portals; otherwise, 0.int insideShadowValid ( const BoundSphere & object, const vec3 & direction ) #
Checks if the given bounding sphere is inside the shadow of the current bounding frustum.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundSphere & object - The bounding sphere.
- const vec3 & direction - The direction vector.
Return value
1 if the given bounding sphere is inside the shadow; otherwise, 0.int insideShadowValid ( const BoundSphere & object, const BoundSphere & light, const vec3 & offset ) #
Checks if the given bounding sphere is inside the shadow of the current bounding frustum and outside the bounding sphere of a light source.The method doesn't check the status of the current bounding frustum.
Arguments
- const BoundSphere & object - The bounding sphere.
- const BoundSphere & light - The bounding sphere of the light source.
- const vec3 & offset - The offset vector.
Return value
1 if the given bounding sphere is inside the shadow and outside the given light source bounding sphere; otherwise, 0.const vec3 * getPoints ( ) #
Returns the vector of points of the current bounding frustum.Return value
Vector of points.Last update:
2019-12-25
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)