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.

Unigine.BoundSphere Class

This class serves to construct the bounding sphere in single precision coordinates.

Notice
Instances of this class are deleted automatically when it is necessary.

In case of double precision coordinates, the bounding sphere should be constructed by using the WorldBoundSphere class. It includes the same functions as the BoundSphere class, but its functions deal with the double precision coordinates.

Notice
To support both single and double precision builds, you can use the WorldBoundSphere class only. The engine will automatically substitute it with the BoundSphere if it is required.

BoundSphere Class

Properties

float Radius#

The bounding sphere radius.

vec3 Center#

The bounding sphere center.

bool IsValid#

The bounding sphere status.

Members


BoundSphere ( ) #

Constructor. Creates an empty bounding sphere.

BoundSphere ( vec3 center, float radius ) #

Initialization by the center and radius of the bounding sphere.

Arguments

  • vec3 center - The bounding sphere center.
  • float radius - The bounding sphere radius.

BoundSphere ( vec3[] points, int optimal ) #

Initialization by the array of points.

Arguments

  • vec3[] points - Array of points.
  • int optimal - Flag defining if the optimal sphere should be used. If 0, the sphere will be expanded for including all the given points.

BoundSphere ( BoundSphere bs ) #

Initialization by the bounding sphere.

Arguments

  • BoundSphere bs - The bounding sphere.

BoundSphere ( BoundSphere bs, mat4 transform ) #

Initialization by the bounding sphere and setting the given transformation matrix to the new bounding sphere.

Arguments

  • BoundSphere bs - The bounding sphere.
  • mat4 transform - Transformation matrix.

explicit BoundSphere ( BoundBox bb ) #

Initialization by the bounding box.

Arguments

  • BoundBox bb - The bounding box.

void Clear ( ) #

Clears the bounding sphere.

void Set ( vec3 center, float radius ) #

Sets the bounding sphere by its center and radius.

Arguments

  • vec3 center - Center of the bounding sphere.
  • float radius - Radius of the bounding sphere.

void Set ( vec3[] points, int optimal ) #

Set the bounding sphere by an array of points.

Arguments

  • vec3[] points - Array of points.
  • int optimal - Flag defining if the optimal sphere should be used. If 0, the sphere will be expanded for including all the given points.

void Set ( BoundSphere bs ) #

Sets the bounding sphere.

Arguments

  • BoundSphere bs - Bounding sphere.

void Set ( BoundSphere bs, mat4 transform ) #

Sets the bounding sphere by a bounding sphere with a transformation matrix taken into account.

Arguments

  • BoundSphere bs - Bounding sphere.
  • mat4 transform - Transformation matrix.

void Set ( BoundBox bb ) #

Sets the bounding sphere by the bounding box.

Arguments

  • BoundBox bb - Bounding box.

void SetTransform ( mat4 transform ) #

Sets the given transformation matrix to bounding sphere.

Arguments

  • mat4 transform - Transformation matrix.

void SetTransform ( dmat4 transform ) #

Sets the given transformation matrix to bounding sphere.

Arguments

  • dmat4 transform - Transformation matrix.

int Compare ( BoundSphere bs ) #

Compares the bounding sphere with the given one. The degree of precision is equal to 1.0e-6f.

Arguments

  • BoundSphere bs - The bounding sphere to compare with.

Return value

1 if the radii and the centers of both bounding spheres are equal; otherwise, 0.

void Expand ( vec3 point ) #

Expands the current bounding sphere to include the given point.

Arguments

  • vec3 point - Coordinates of the point.

void Expand ( vec3[] points ) #

Expands the current bounding sphere to include the given points.

Arguments

  • vec3[] points - Array of points.

void Expand ( BoundSphere bs ) #

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

Arguments

  • BoundSphere bs - Bounding sphere to be included.

void Expand ( BoundBox bb ) #

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

Arguments

  • BoundBox bb - Bounding box to be included.

void ExpandRadius ( vec3 point ) #

Expands the radius of the bounding sphere.

Arguments

  • vec3 point - Point coordinates setting the end point of radius.

void ExpandRadius ( vec3[] points ) #

Expands the radius of the current bounding sphere to include all points of the array.

Arguments

  • vec3[] points - Array of points.

void ExpandRadius ( BoundSphere bs ) #

Expands the radius of the bounding sphere by using the radius of the given bounding sphere.

Arguments

  • BoundSphere bs - Bounding sphere.

void ExpandRadius ( BoundBox bb ) #

Expands the radius of the bounding sphere by using the max and min points of the given bounding box.

Arguments

  • BoundBox bb - Bounding box.

int Inside ( vec3 point ) #

Checks if the given point is inside the current bounding sphere.

Arguments

  • vec3 point - Point coordinates.

Return value

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

int Inside ( vec3 point, float radius ) #

Checks if the sphere is inside the bounding sphere.

Arguments

  • vec3 point - Center of the sphere.
  • float radius - Radius of the sphere.

Return value

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

int Inside ( vec3 min, vec3 max ) #

Checks if the box is inside the bounding sphere.

Arguments

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

Return value

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

int Inside ( BoundSphere bs ) #

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

Arguments

  • BoundSphere bs - Bounding sphere.

Return value

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

int Inside ( BoundBox bb ) #

Checks if the bounding box is inside the bounding sphere.

Arguments

  • BoundBox bb - Bounding box.

Return value

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

int InsideAll ( BoundSphere bs ) #

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

Arguments

  • BoundSphere bs - Bounding sphere.

Return value

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

int InsideAll ( BoundBox bb ) #

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

Arguments

  • BoundBox bb - Bounding box.

Return value

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

int RayIntersection ( vec3 point, vec3 direction ) #

Checks for an intersection of a ray with the current bounding sphere.

Arguments

  • vec3 point - The starting point of the ray.
  • vec3 direction - The direction vector of the ray.

Return value

1 if an intersection has occurred; otherwise, 0.

int GetIntersection ( vec3 p0, vec3 p1 ) #

Checks for an intersection of a line with the current bounding sphere.

Arguments

  • vec3 p0 - The starting point of the line.
  • vec3 p1 - The ending point of the line.

Return value

1 if an intersection has occurred; otherwise, 0.

float Distance ( vec3 point ) #

Returns the distance from the given point to the closest point of the current bounding sphere.

Arguments

  • vec3 point - Coordinates of the point.

Return value

Distance from the point, in units.
Last update: 2020-07-31
Build: ()