This page has been translated automatically.
编程
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
应用程序接口
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
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::WorldBoundSphere Class

Header:#include <UnigineBounds.h>

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

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

WorldBoundSphere Class

Members


WorldBoundSphere()

Constructor. Creates an empty bounding sphere.

WorldBoundSphere(const dvec3 & center, double radius)

Construction. Initializes bounding sphere by the center and radius of the bounding sphere.

Arguments

  • const dvec3 & center - The bounding sphere center.
  • double radius - The bounding sphere radius.

WorldBoundSphere(const WorldBoundSphere & bs)

Constructor. Initializes by given bounding sphere.

Arguments

  • const WorldBoundSphere & bs - The bounding sphere.

WorldBoundSphere(const WorldBoundBox & bb)

Constructor. Initializes by given bounding box.

Arguments

  • const WorldBoundBox & bb - The bounding box.

void set(const dvec3 & center, double radius)

Sets the bounding sphere by its center and radius.

Arguments

  • const dvec3 & center - The bounding sphere center.
  • double radius - The bounding sphere radius.

void set(const WorldBoundBox & bb)

Sets the bounding sphere by the bounding box.

Arguments

  • const WorldBoundBox & bb - The bounding box.

void set(const WorldBoundSphere & bs)

Sets the bounding sphere.

Arguments

  • const WorldBoundSphere & bs - The bounding sphere.

const dvec3 & getCenter()

Gets the bounding sphere center.

Return value

The bounding sphere center.

double getRadius()

Gets the bounding sphere radius.

Return value

The bounding sphere radius.

int isValid()

Checks the bounding sphere status.

Return value

1 if the bounding sphere radius has a positive value.

void clear()

Clears the bounding sphere.

void expand(const WorldBoundSphere & bs)

Expands the current bounding sphere for including given bounding sphere.

Arguments

  • const WorldBoundSphere & bs - The bounding sphere.

void expand(const WorldBoundBox & bb)

Expands the current bounding sphere for including given bounding box.

Arguments

  • const WorldBoundBox & bb - The bounding box.

void expand(const dvec3 & point)

Expands the current bounding sphere for including given point.

Arguments

  • const dvec3 & point - Point coordinates.

int inside(const dvec3 & min, const dvec3 & max)

Checks if the box is inside the bounding sphere.

Arguments

  • const dvec3 & min - The box minimum coordinates.
  • const dvec3 & max - The box maximum coordinates.

Return value

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

int inside(const WorldBoundBox & bb)

Checks if the bounding box is inside the bounding sphere.

Arguments

  • const WorldBoundBox & bb - The bounding box.

Return value

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

int inside(const WorldBoundSphere & bs)

Checks if the bounding sphere is inside the bounding sphere.

Arguments

  • const WorldBoundSphere & bs - The bounding sphere.

Return value

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

int inside(const dvec3 & point, double radius)

Checks if the sphere is inside the bounding sphere.

Arguments

  • const 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 sphere; otherwise, 0.

int insideAll(const WorldBoundSphere & bs)

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

Arguments

  • const WorldBoundSphere & bs

Return value

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

int insideAll(const WorldBoundBox & bb)

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

Arguments

  • const WorldBoundBox & bb

Return value

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

~WorldBoundSphere()

Destructor.
Last update: 2017-07-03
Build: ()