Class implementing sphere-related functionality. More...
#include </home/chochlik/devel/oglplus/include/oglplus/math/sphere.hpp>
Public Member Functions | |
Sphere (void) | |
Constructs a unit sphere at the origin. | |
Sphere (T x, T y, T z, T r) | |
Constructs a sphere at the specified position and the specified radius. More... | |
Sphere (const Vector< T, 3 > &position, T radius) | |
Constructs a sphere with the specified radius at the position. More... | |
template<typename U > | |
Sphere (const Sphere< U > &that) | |
Copy construction from angles using different underlying type. | |
const Vector< T, 3 > & | Center (void) const |
Returns the position of the center of the sphere. | |
void | Center (const Vector< T, 3 > &position) |
Sets the position of the sphere. | |
void | Translate (const Vector< T, 3 > &offset) |
Translates the sphere to a new position by offset . | |
void | Transform (const Matrix< T, 4, 4 > &matrix) |
Transforms the spheres origin by the specified matrix. | |
bool | Degenerate (void) const |
Returns true if the sphere is degenerate (has zero radius) | |
T | Radius (void) const |
Returns the radius of the sphere. More... | |
void | Radius (T radius) |
Sets the radius of the sphere. More... | |
void | Grow (T amount) |
Grows the sphere by the specified amount . More... | |
void | Shrink (T amount) |
Shrinks the sphere by the specified amount . More... | |
void | Scale (T amount) |
Scales the sphere by the specified amount . More... | |
T | Diameter (void) const |
Returns the diameter of the sphere. More... | |
bool | IntersectsWith (const Sphere &that) const |
Returns true if this sphere intersects with that sphere. | |
Friends | |
bool | Intersecting (const Sphere &a, const Sphere &b) |
Returns true if spheres a and b are intersecting. | |
Class implementing sphere-related functionality.
Sphere
is a lightweight class for working with spheres.
Constructs a sphere at the specified position and the specified radius.
Constructs a sphere with the specified radius at the position.
T oglplus::Sphere< T >::Diameter | ( | void | ) | const |
Returns the diameter of the sphere.
void oglplus::Sphere< T >::Grow | ( | T | amount | ) |
Grows the sphere by the specified amount
.
T oglplus::Sphere< T >::Radius | ( | void | ) | const |
Returns the radius of the sphere.
Referenced by oglplus::Sphere< GLfloat >::Diameter(), and oglplus::Sphere< GLfloat >::Shrink().
void oglplus::Sphere< T >::Radius | ( | T | radius | ) |
Sets the radius of the sphere.
void oglplus::Sphere< T >::Scale | ( | T | amount | ) |
Scales the sphere by the specified amount
.
void oglplus::Sphere< T >::Shrink | ( | T | amount | ) |
Shrinks the sphere by the specified amount
.