This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
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

Bounding box.

To use this class, include the UnigineBounds.h file.

Unigine::BoundBox Class

Members


BoundBox ()

Default constructor that produces 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.

~BoundBox ()

Destructor.

void clear ()

Clears the bounding box.

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.

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

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

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

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

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

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

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

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

UNIGINE_INLINE int isValid () const

Checks the bounding box status.

Return value

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

UNIGINE_INLINE const vec3 & getMin () const

Gets the minimum coordinates of the bounding box.

Return value

The bounding box minimum coordinates.

UNIGINE_INLINE const vec3 & getMax () const

Gets the maximum coordinates of the bounding box

Return value

The bounding box maximum coordinates.
Last update: 2017-07-03
Build: ()