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
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::BoundSphere Class

Bounding sphere.

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

Unigine::BoundSphere Class

Members


BoundSphere ()

Default constructor that produces an empty bounding sphere.

BoundSphere (const vec3 & center, float radius)

Initialization by the center and radius of the bounding sphere.

Arguments

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

BoundSphere (const BoundSphere & bs)

Initialization by the bounding sphere.

Arguments

  • const BoundSphere & bs - The bounding sphere.

explicit BoundSphere (const BoundBox & bb)

Initialization by the bounding box.

Arguments

  • const BoundBox & bb - The bounding box.

~BoundSphere ()

Destructor.

void clear ()

Clears the bounding sphere.

void set (const vec3 & center, float radius)

Sets the bounding sphere by its center and radius.

Arguments

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

void set (const BoundSphere & bs)

Sets the bounding sphere.

Arguments

  • const BoundSphere & bs - The bounding sphere.

void set (const BoundBox & bb)

Sets the bounding sphere by 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 sphere.

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 sphere; otherwise, 0 is returned.

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

Checks if the box is inside the bounding sphere.

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 sphere; otherwise, 0 is returned.

int inside (const BoundSphere & bs) const

Checks if the bounding sphere is inside the bounding sphere.

Arguments

  • const BoundSphere & bs - The bounding sphere.

Return value

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

int inside (const BoundBox & bb) const

Checks if the bounding box is inside the bounding sphere.

Arguments

  • const BoundBox & bb - The bounding box.

Return value

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

UNIGINE_INLINE int isValid () const

Checks the bounding sphere status.

Return value

Return 1 if the bounding sphere radius has a positive value.

UNIGINE_INLINE const vec3 & getCenter () const

Gets the bounding sphere center.

Return value

The bounding sphere center.

UNIGINE_INLINE float getRadius () const

Gets the bounding sphere radius.

Return value

The bounding sphere radius.
Last update: 2017-07-03
Build: ()