This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector 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.

WorldBoundBox Class

Warning
UnigineScript is deprecated and will be removed in future releases. Please consider using C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScipt is not guaranteed, as the current level of support assumes only fixing critical issues.

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


static WorldBoundBox ( ) #

Default constructor. Creates an empty bounding box.

WorldBoundBox ( dvec3 min, dvec3 max ) #

Constructor. Initializes new bounding box by minimum and maximum coordinates of the bounding box.

Arguments

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

WorldBoundBox ( WorldBoundBox bb ) #

Constructor. Initializes new bounding box by using given bounding box.

Arguments

  • WorldBoundBox bb - Bounding box.

WorldBoundBox ( WorldBoundSphere bs ) #

Constructor. Initializes new bounding box by the using given bounding sphere.

Arguments

  • WorldBoundSphere bs - Bounding sphere.

WorldBoundBox ( BoundBox bb, dmat4 transform ) #

Arguments

  • BoundBox bb
  • dmat4 transform

void clear ( ) #

Clears the bounding box.

void set ( dvec3 min, dvec3 max ) #

Sets the bounding box by its minimum and maximum coordinates.

Arguments

  • dvec3 min - Minimum coordinates of the bounding box.
  • dvec3 max - Maximum coordinates of the bounding box.

void set ( dvec3[] points ) #

Sets the bounding box by the coordinates of points in space to be enclosed by it.

Arguments

  • dvec3[] points - Array of points to be enclosed by the bounding box.

void set ( BoundBox bb, dmat4 transform ) #

Sets the bounding box by the given bounding box with the given transformation matrix taken into account.

Arguments

  • BoundBox bb - Source bounding box.
  • dmat4 transform - Transformation matrix.

void set ( WorldBoundSphere bs ) #

Sets the bounding box by the bounding sphere.

Arguments

  • WorldBoundSphere bs - The bounding sphere.

void set ( WorldBoundBox bb ) #

Sets the bounding box.

Arguments

  • WorldBoundBox bb - The bounding box.

void setTransform ( dmat4 transform ) #

Sets the given transformation matrix to the bounding box.

Arguments

  • dmat4 transform - Transformation matrix.

int compare ( WorldBoundBox bb ) #

Compares the current bounding box with the given one.

Arguments

  • WorldBoundBox bb - The bounding box to compare with.

Return value

1 if the size and position of both bounding boxes are equal; otherwise, 0.

void expand ( dvec3 point ) #

Expands the current bounding box to include the given point.

Arguments

  • dvec3 point - Coordinates of the point.

void expand ( dvec3[] points ) #

Expands the current bounding box to enclose all given points.

Arguments

  • dvec3[] points - Array of points to be enclosed by the bounding box.

void expand ( WorldBoundSphere bs ) #

Expands the current bounding box to include the given bounding sphere.

Arguments

  • WorldBoundSphere bs - The bounding sphere.

void expand ( WorldBoundBox bb ) #

Expands the current bounding box to include the given bounding box.

Arguments

  • WorldBoundBox bb - The bounding box.

int inside ( dvec3 point ) #

Checks if the specified point is inside the current bounding box.

Arguments

  • dvec3 point - Coordinates of the point.

Return value

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

int inside ( dvec3 point, double radius ) #

Checks if the specified sphere is inside the current bounding box.

Arguments

  • dvec3 point - The coordinates of the center of the sphere.
  • double radius - The sphere radius.

Return value

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

int inside ( dvec3 min, dvec3 max ) #

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

Arguments

  • dvec3 min - Minimum coordinates of the box.
  • dvec3 max - Maximum coordinates of the box.

Return value

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

int inside ( WorldBoundSphere bs ) #

Checks if the specified bounding sphere is inside the current bounding box.

Arguments

  • WorldBoundSphere bs - The bounding sphere.

Return value

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

int inside ( WorldBoundBox bb ) #

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

Arguments

  • WorldBoundBox bb - The bounding box.

Return value

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

int insideAll ( WorldBoundSphere bs ) #

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

Arguments

  • WorldBoundSphere bs - The bounding sphere.

Return value

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

int insideAll ( WorldBoundBox bb ) #

Checks if the whole given bounding box is inside the current bounding box.

Arguments

  • WorldBoundBox bb - The bounding box.

Return value

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

int insideCube ( int face, dvec3 point ) #

Checks if a face of the current bounding box is inside the cube represented by minimum and maximum coordinates of the bounding box.

Arguments

  • int face - The face index from 0 to 5.
  • dvec3 point - Offset.

Return value

1 if the face is inside the bounding cube; otherwise, 0.

int irayIntersectionValid ( dvec3 p, dvec3 idirection ) #

Checks for an intersection between a ray and the current bounding box. This function uses the inverse direction of the ray, which increases performance.

Arguments

  • dvec3 p - Starting point of the ray.
  • dvec3 idirection - Inverse direction of the ray.

Return value

1 if the given ray intersects the bounding box; otherwise, 0.

double distanceValid ( dvec3 point ) #

Returns the distance from the given point to the closest vertex of the bounding box.

Arguments

  • dvec3 point - Coordinates of the point.

Return value

Distance from the given point to the closest vertex of the bounding box, in units.

bool 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

true if the bounding box minimum and maximum coordinates are valid, otherwise, false.

dvec3 getMin ( ) #

Returns the minimum coordinates of the bounding box.

Return value

Bounding box minimum coordinates.

dvec3 getMax ( ) #

Returns the maximum coordinates of the bounding box.

Return value

Bounding box maximum coordinates.

dvec3 getCenter ( ) #

Returns the center point of the current bounding box.

Return value

Center point.
Last update: 2020-04-10
Build: ()