BoundFrustum Class
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScipt (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
This class serves to construct the bounding frustum in single precision coordinates.
Instances of this class are deleted automatically, when 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 required.
BoundFrustum Class
Members
BoundFrustum ( ) #
Constructor. Creates an empty bounding frustum.BoundFrustum ( mat4 projection, mat4 modelview ) #
Initialization by the projection and modelview matrices.Arguments
- mat4 projection - A projection matrix.
- mat4 modelview - A modelview matrix.
BoundFrustum ( BoundFrustum bf ) #
Initialization by the bounding frustum.Arguments
- BoundFrustum bf - The bounding frustum.
BoundFrustum ( BoundFrustum bf, mat4 itransform ) #
Initialization by the bounding frustum and transformation matrix.Arguments
- BoundFrustum bf - The bounding frustum.
- mat4 itransform - The inverse transformation matrix.
void set ( mat4 projection, mat4 modelview ) #
Sets the bounding frustum by matrices.Arguments
- mat4 projection - Projection matrix.
- mat4 modelview - Modelview matrix.
void set ( BoundFrustum bf ) #
Sets the bounding frustum by the bounding frustum.Arguments
- BoundFrustum bf - The bounding frustum.
void set ( BoundFrustum bf, mat4 itransform ) #
Sets the bounding frustum by the bounding frustum and transformation matrix.Arguments
- BoundFrustum bf - The bounding frustum.
- mat4 itransform - The inverse transformation matrix.
void setITransform ( mat4 itransform ) #
Sets the transformation matrix by an inverse transformation matrix.Arguments
- mat4 itransform - The inverse transformation matrix.
void setITransform ( dmat4 itransform ) #
Sets the transformation matrix by an inverse transformation matrix.Arguments
- dmat4 itransform - The inverse transformation matrix.
int compare ( BoundFrustum bf ) #
Compares the current bounding frustum with the given one.Arguments
- BoundFrustum bf - Bounding frustum.
Return value
1 if the current bounding frustum is equal to the given one; otherwise, 0.void expand ( float radius ) #
Expands the current bounding frustum by the given radius.Arguments
- float radius - Radius.
int inside ( vec3 point ) #
Checks if the point is inside the bounding frustum.Arguments
- vec3 point - The coordinates of the point.
Return value
1 if the point is inside the bounding frustum; otherwise, 0.int inside ( vec3 point, float radius ) #
Checks if the sphere is inside the bounding frustum.Arguments
- 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 ( vec3 min, vec3 max ) #
Checks if the box is inside the bounding frustum.Arguments
- vec3 min - The box minimum coordinate.
- vec3 max - The box maximum coordinate.
Return value
1 if the box is inside the bounding frustum; otherwise, 0.int inside ( vec3[] points ) #
Checks if a set of points is inside the bounding frustum.Arguments
- vec3[] points - Array of points.
Return value
1 if the points are inside the bounding frustum; otherwise, 0.int inside ( BoundSphere bs ) #
Checks if the bounding sphere is inside the bounding frustum.Arguments
- BoundSphere bs - Bounding sphere.
Return value
1 if the bounding sphere is inside the bounding frustum; otherwise, 0.int inside ( BoundBox bb ) #
Checks if the bounding box is inside the bounding frustum.Arguments
- BoundBox bb - Bounding box.
Return value
1 if the bounding box is inside the bounding frustum; otherwise, 0.int inside ( BoundFrustum bf ) #
Checks if the specified bounding frustum is inside the current bounding frustum.Arguments
- BoundFrustum bf - Bounding frustum.
Return value
1 if the specified bounding frustum is inside the bounding frustum; otherwise, 0.int insideAll ( BoundBox bb ) #
Checks if the whole given bounding box is inside the current bounding frustum.Arguments
- BoundBox bb - Bounding box.
Return value
1 if the whole bounding box is inside the bounding frustum; otherwise, 0.int insideAll ( BoundSphere bs ) #
Checks if the whole given bounding sphere is inside the current bounding frustum.Arguments
- BoundSphere bs - Bounding sphere.
Return value
1 if the whole bounding sphere is inside the bounding frustum; otherwise, 0.int insideAll ( BoundFrustum bf ) #
Checks if the whole specified bounding frustum is inside the current bounding frustum.Arguments
- BoundFrustum bf - Bounding frustum.
Return value
1 if the whole specified bounding frustum is inside the current bounding frustum; otherwise, 0.int insidePlanes ( BoundSphere bs ) #
Checks if the given bounding sphere is inside the volume defined by the planes of the current bounding frustum.Arguments
- BoundSphere bs - Bounding sphere.
Return value
1 if the given bounding sphere is inside the volume; otherwise, 0.int insidePlanes ( BoundBox bb ) #
Checks if the given bounding box is inside the volume defined by the planes of the current bounding frustum.Arguments
- BoundBox bb - Bounding box.
Return value
1 if the given bounding box is inside the volume; otherwise, 0.int insidePlanes ( BoundFrustum bf ) #
Checks if the given bounding frustum is inside the volume defined by the planes of the current bounding frustum.Arguments
- BoundFrustum bf - Bounding frustum.
Return value
1 if the given bounding frustum is inside the volume; otherwise, 0.int insideShadowValid ( BoundSphere object, 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
- BoundSphere object - Bounding sphere.
- vec3 direction - The direction vector.
Return value
1 if the given bounding sphere is inside the shadow; otherwise, 0.int insideShadowValid ( BoundSphere object, BoundSphere light, 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
- BoundSphere object - Bounding sphere.
- BoundSphere light - The bounding sphere of the light source.
- 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.bool isValid ( ) #
Checks the bounding frustum status.Return value
true if the bounding frustum is valid, otherwise false.vec3 getCamera ( ) #
Returns the position of the camera.Return value
Camera position.Last update:
2020-07-31
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)