Unravel Engine C++ Reference
Loading...
Searching...
No Matches
math::bsphere Class Reference

Provides storage for common representation of spherical bounding volume, and wraps up common functionality. More...

#include <bsphere.h>

Public Member Functions

 bsphere ()
 
 bsphere (const vec3 &_position, float _radius)
 
 bsphere (float x, float y, float z, float _radius)
 
bool contains_point (const vec3 &point) const
 Tests to see if the specified point falls within this bounding sphere or not. A point precisely on the boundary is also considered to be contained.
 
bool contains_point (const vec3 &point, float tolerance) const
 Tests to see if the specified point falls within this bounding sphere or not, taking into account the provided tolerance. A point precisely on the boundary is also considered to be contained.
 
bspherefrom_points (const char *point_buffer, unsigned int point_count, unsigned int point_stride)
 Calculates a tight fitting bounding sphere from the points supplied.
 
bsphereoperator+= (const vec3 &shift)
 Adjusts the position of the bounding sphere by the specified amount.
 
bsphereoperator-= (const vec3 &shift)
 Adjusts the position of the bounding sphere by the specified amount.
 
bool operator!= (const bsphere &bounds) const
 Test for inequality between this bounding sphere and another.
 
bool operator== (const bsphere &bounds) const
 Test for equality between this bounding sphere and another.
 

Public Attributes

vec3 position
 
float radius
 

Static Public Attributes

static bsphere empty
 

Detailed Description

Provides storage for common representation of spherical bounding volume, and wraps up common functionality.

Definition at line 17 of file bsphere.h.

Constructor & Destructor Documentation

◆ bsphere() [1/3]

math::bsphere::bsphere ( )
inline

Definition at line 23 of file bsphere.h.

◆ bsphere() [2/3]

math::bsphere::bsphere ( const vec3 & _position,
float _radius )
inline

Definition at line 26 of file bsphere.h.

◆ bsphere() [3/3]

math::bsphere::bsphere ( float x,
float y,
float z,
float _radius )
inline

Definition at line 29 of file bsphere.h.

Member Function Documentation

◆ contains_point() [1/2]

bool math::bsphere::contains_point ( const vec3 & point) const
inline

Tests to see if the specified point falls within this bounding sphere or not. A point precisely on the boundary is also considered to be contained.

Definition at line 44 of file bsphere.h.

◆ contains_point() [2/2]

bool math::bsphere::contains_point ( const vec3 & point,
float tolerance ) const
inline

Tests to see if the specified point falls within this bounding sphere or not, taking into account the provided tolerance. A point precisely on the boundary is also considered to be contained.

Definition at line 57 of file bsphere.h.

◆ from_points()

bsphere & math::bsphere::from_points ( const char * point_buffer,
unsigned int point_count,
unsigned int point_stride )

Calculates a tight fitting bounding sphere from the points supplied.

Definition at line 20 of file bsphere.cpp.

◆ operator!=()

bool math::bsphere::operator!= ( const bsphere & bounds) const
inline

Test for inequality between this bounding sphere and another.

Definition at line 100 of file bsphere.h.

◆ operator+=()

bsphere & math::bsphere::operator+= ( const vec3 & shift)
inline

Adjusts the position of the bounding sphere by the specified amount.

Definition at line 76 of file bsphere.h.

◆ operator-=()

bsphere & math::bsphere::operator-= ( const vec3 & shift)
inline

Adjusts the position of the bounding sphere by the specified amount.

Definition at line 88 of file bsphere.h.

◆ operator==()

bool math::bsphere::operator== ( const bsphere & bounds) const
inline

Test for equality between this bounding sphere and another.

Definition at line 111 of file bsphere.h.

Member Data Documentation

◆ empty

bsphere math::bsphere::empty
static

Definition at line 125 of file bsphere.h.

◆ position

vec3 math::bsphere::position

Definition at line 119 of file bsphere.h.

◆ radius

float math::bsphere::radius

Definition at line 120 of file bsphere.h.


The documentation for this class was generated from the following files: