Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins

BoundFrustum Class

This class serves to construct the bounding frustum in single precision coordinates.

Notice
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.

Notice
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 (BoundFrustum bf)

Constructor. Creates a bounding frustum initialized by the bounding frustum.

Arguments

  • BoundFrustum bf - Bounding frustum.

BoundFrustum (variable v0, variable v1)

Constructor. Creates a bounding frustum initialized by one of the following:
  • mat4 projection and mat4 modelview - projection and modelview matrices.
  • BoundFrustum bf and mat4 itransform - the bounding frustum and inverse transformation matrix.

Arguments

  • variable v0 - Argument of one of the following types:
    • mat4 projection - Projection matrix.
    • BoundFrustum bf - The bounding frustum.
  • variable v1 - Argument of one of the following types:
    • mat4 modelview - Modelview matrix.
    • mat4 itransform - Inverse transformation matrix.

vec3 getCamera ()

Returns the position of the camera.

Return value

Camera position.

int insideAll (variable v)

Checks if the given bounding sphere or the bounding box is inside the current bounding frustum.

Arguments

  • variable v - Argument of one of the following types:
    • BoundSphere bs - The bounding sphere.
    • BoundBox bb - The bounding box.

Return value

1 if the given bounding sphere of the bounding box is inside the bounding frustum; otherwise, 0.

int inside (variable v)

Depending on the variable passed as an argument, the function performs the following:
  • If vec3 is passed, the function checks if the given point is inside the current bounding frustum.
  • If BoundBox is passed, the function checks if the given bounding box is inside the current bounding frustum.
  • If BoundSphere is passed, the function checks if the given bounding sphere is inside the current bounding frustum.

Arguments

  • variable v - Argument of one of the following types:
    • vec3 point - Coordinates of the point.
    • BoundSphere bs - The bounding sphere.
    • BoundBox bb - The bounding box.

Return value

1 if the bounding box or the bounding sphere or the point is inside the current bounding frustum; otherwise, 0.

int inside (variable v0, variable v1)

Checks if the specified sphere or the box is inside the current bounding frustum. Variables, passed as arguments, can be the following:
  • vec3 point and float radius
  • vec3 min and vec3 max

Arguments

  • variable v0 - Argument of one of the following types:
    • vec3 point - Coordinates of the sphere center.
    • vec3 min - Bounding box minimum coordinates.
  • variable v1 - Argument of one of the following types:
    • float radius - Radius of the bounding sphere.
    • vec3 max - Bounding box maximum coordinates.

Return value

1 if the

int isValid ()

Checks if the bounding frustum is valid.

Return value

1 if the bounding frustum is valid; otherwise, 0.

void setITransform (mat4 transform)

Sets the inverse transformation matrix for the current bounding frustum.

Arguments

  • mat4 transform - Inverse transformation matrix.

void set (variable v0, variable v1)

Sets the bounding frustum. The function can receive the following arguments:
  • mat4 projection and mat4 modelview - projection and modelview matrices.
  • BoundFrustum bf and mat4 itransform - the bounding frustum and inverse transformation matrix.

Arguments

  • variable v0 - Argument of one of the following types:
    • mat4 projection - Projection matrix.
    • BoundFrustum bf - The bounding frustum.
  • variable v1 - Argument of one of the following types:
    • mat4 modelview - Modelview matrix.
    • mat4 itransform - Inverse transformation matrix.

void set (variable v)

Depending on the variable passed as argument, the function sets the bounding frustum by the given bounding sphere or the bounding box.

Arguments

  • variable v - Argument of one of the following types:
    • BoundSphere bs - The bounding sphere.
    • BoundBox bb - The bounding box.
Last update: 2017-07-03