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
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Unigine::BoundBox Class

Header:#include <UnigineBounds.h>

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(const vec3 & min, const vec3 & max)

Initialization by minimum and maximum coordinates of the bounding box.

Arguments

  • const vec3 & min - The bounding box minimum coordinates.
  • const vec3 & max - The bounding box maximum coordinates.

BoundBox(const BoundBox & bb)

Initialization by the bounding box.

Arguments

  • const BoundBox & bb - The bounding box.

explicit BoundBox(const BoundSphere & bs)

Initialization by the bounding sphere.

Arguments

  • const BoundSphere & bs - The bounding sphere.

void set(const vec3 & min, const vec3 & max)

Sets the bounding box by its minimum and maximum coordinates.

Arguments

  • const vec3 & min - The bounding box minimum coordinates.
  • const vec3 & max - The bounding box maximum coordinates.

void set(const BoundSphere & bs)

Sets the bounding box by the bounding sphere.

Arguments

  • const BoundSphere & bs - The bounding sphere.

void set(const BoundBox & bb)

Sets the bounding box.

Arguments

  • const BoundBox & bb - The bounding box.

const vec3 & getMax() const

Gets the maximum coordinates of the bounding box

Return value

The bounding box maximum coordinates.

const vec3 & getMin() const

Gets the minimum coordinates of the bounding box.

Return value

The bounding box minimum coordinates.

void setTransform(const mat4 & transform)

Arguments

  • const mat4 & transform

void setTransform(const dmat4 & transform)

Arguments

  • const dmat4 & transform

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(const BoundSphere & bs)

Arguments

  • const BoundSphere & bs

void expand(const BoundBox & bb)

Arguments

  • const BoundBox & bb

void expand(const vec3 & point)

Arguments

  • const vec3 & point

int inside(const vec3 & point, float radius) const

Checks if the sphere is inside the bounding box.

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 box; otherwise, 0.

int inside(const vec3 & min, const vec3 & max) const

Checks if the box is inside the bounding box.

Arguments

  • const vec3 & min - The box minimum coordinates.
  • const vec3 & max - The box maximum coordinates.

Return value

1 if the box is inside the bounding box; otherwise, 0.

int inside(const BoundSphere & bs) const

Checks if the bounding sphere is inside the bounding box.

Arguments

  • const BoundSphere & bs - The bounding sphere.

Return value

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

int inside(const BoundBox & bb) const

Checks if the bounding box is inside the bounding box.

Arguments

  • const BoundBox & bb - The bounding box.

Return value

1 if the bounding box is inside the bounding box; otherwise, 0.

int insideAll(const BoundBox & bb)

Arguments

  • const BoundBox & bb

int insideAll(const BoundSphere & bs)

Arguments

  • const BoundSphere & bs
Last update: 03.07.2017
Build: ()