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.

WorldBoundBox Class

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

Bounding boxes has better precision quality but it takes more time for calculation in comparison with bounding spheres.

By using this class you can easily find the common bounding box for several objects by expanding the bounding box.

WorldBoundBox Class

Members


WorldBoundBox()

Default constructor. Creates an empty bounding box.

void set(variable v)

Sets the bounding box by the given bounding sphere or the bounding box.

Arguments

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

void set(variable v0, variable v1)

Sets the bounding box. The function can receive the following arguments:
  • vec3 and vec3 - bounding box minimum and maximum coordinates.
  • BoundBox and mat4 - bounding box and its transformation matrix.

Arguments

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

dvec3 getMax()

Returns the maximum coordinates of the bounding box.

Return value

Bounding box maximum coordinates.

dvec3 getMin()

Returns the minimum coordinates of the bounding box.

Return value

Bounding box minimum coordinates.

int isValid()

Checks if the bounding box coordinates are valid (minimum coordinate along the X axis is less or equal to the maximum coordinate along the X axis).

Return value

1 if the coordinates are valid; otherwise, 0.

void expand(variable v)

Depending on the received arguments, the function performs the following:
  • If the dvec3 is passed, the function expands the current bounding box so that the point with the given coordinates is inside this bounding box.
  • If the WorldBoundSphere is passed, the function expands the current bounding box so that it can be described around the given bounding sphere.
  • If the WorldBoundBox is passed, the function expands the current bounding box so that it can be described around the given bounding box.

Arguments

  • variable v - Argument of one of the following types:
    • dvec3 point - Coordinates of the point.
    • WorldBoundSphere bs - The bounding sphere.
    • WorldBoundBox bb - The bounding box.

int inside(variable v)

Depending on the variable passed as an argument, the function performs the following:
  • If the dvec3 is passed, the function checks if the given point is inside the current bounding box.
  • If the WorldBoundBox is passed, the function checks if the given bounding box is inside the current bounding box.
  • If the WorldBoundSphere is passed, the function checks if the given bounding sphere is inside the current bounding box.

Arguments

  • variable v - Argument of one of the following types:
    • dvec3 point - Coordinates of the point.
    • WorldBoundBox bb - The bounding box.
    • WorldBoundSphere bs - The bounding sphere.

Return value

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

int inside(variable v0, variable v1)

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

Arguments

  • variable v0 - Argument of one of the following types:
    • dvec3 point - Coordinates of the sphere center.
    • dvec3 min - Bounding box minimum coordinates.
  • variable v1 - Argument of one of the following types:
    • double radius - The sphere radius.
    • dvec3 max - Bounding box maximum coordinates.

Return value

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

int insideAll(variable v)

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

Arguments

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

Return value

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

WorldBoundBox(variable v)

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

Arguments

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

WorldBoundBox(variable v0, variable v1)

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

Arguments

  • variable v0 - Argument of one of the following types:
    • dvec3 min - Bounding box minimum coordinates.
    • BoundBox bb - The bounding box.
  • variable v1 - Argument of one of the following types:
    • dvec3 max - Bounding box maximum coordinates.
    • mat4 transform - Transformation matrix.
Last update: 2017-07-03
Build: ()