This page has been translated automatically.
Programming
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

BoundBox Class

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

Notice
Instances of this class are deleted automatically when it is necessary.

In case of double precision coordinates, the bounding box should be constructed by using the WorldBoundBoxclass. It includes the same functions as theBoundBox class, but its functions deal with the double precision coordinates.

Notice
To support both single and double precision builds, you can use the WorldBoundBox class only. The engine will automatically substitute it with the BoundBox if it is required.

BoundBox Class

Members


BoundBox()

Constructor. Creates an empty bounding box.

BoundBox(variable v)

Constructor. Creates a bounding box initialized by one of the following:
  • BoundBox - the bounding box.
  • BoundSphere - the bounding sphere.

Arguments

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

BoundBox(variable v1, variable v2)

Constructor. Creates a bounding box initialized by one of the following:
  • vec3 and vec3 - minimum and maximum coordinates of the bounding box respectively.
  • BoundBox and mat4 - the bounding box and its transformation matrix.

Arguments

  • variable v1 - Argument of one of the following types:
    • vec3 min - Bounding box minimum coordinates.
    • BoundBox bb - The bounding box.
  • variable v2 - Argument of one of the following types:
    • vec3 max - Bounding box maximum coordinates.
    • mat4 transform - Transformation matrix.

vec3 getMax() const

Gets the maximum coordinates of the bounding box

Return value

The bounding box maximum coordinates.

vec3 getMin() const

Gets the minimum coordinates of the bounding box.

Return value

The bounding box minimum coordinates.

int isValid() const

Checks the bounding box status.

Return value

1 if the bounding box minimum and maximum coordinates are valid; otherwise, 0.

void clear()

Clears the bounding box.

void expand(Variable v)

Arguments

  • Variable v
Last update: 2017-07-03
Build: ()