This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
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
CIGI Client Plugin
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.

Unigine.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 WorldBoundBox class. It includes the same functions as the BoundBox 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(vec3 min, vec3 max)

Initialization by minimum and maximum coordinates of the bounding box.

Arguments

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

BoundBox(BoundBox bb)

Initialization by the bounding box.

Arguments

  • BoundBox bb - The bounding box.

explicit BoundBox(BoundSphere bs)

Initialization by the bounding sphere.

Arguments

  • BoundSphere bs - The bounding sphere.

void set(vec3 min, vec3 max)

Sets the bounding box by its minimum and maximum coordinates.

Arguments

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

void set(BoundSphere bs)

Sets the bounding box by the bounding sphere.

Arguments

  • BoundSphere bs - The bounding sphere.

void set(BoundBox bb)

Sets the bounding box.

Arguments

  • BoundBox bb - The bounding box.

vec3 getMax() const

Returns the maximum coordinates of the bounding box.

Return value

The bounding box maximum coordinates.

vec3 getMin() const

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

int inside(vec3 point, float radius) const

Checks if the sphere is inside the bounding box.

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

int inside(vec3 min, vec3 max) const

Checks if the box is inside the bounding box.

Arguments

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

Return value

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

int inside(BoundSphere bs) const

Checks if the bounding sphere is inside the bounding box.

Arguments

  • BoundSphere bs - The bounding sphere.

Return value

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

int inside(BoundBox bb) const

Checks if the bounding box is inside the bounding box.

Arguments

  • BoundBox bb - The bounding box.

Return value

1 if the bounding box is inside the bounding box; otherwise, 0.
Last update: 2018-08-10
Build: ()