![]() |
Murl Engine API
Version 2018.3
|
A sphere class. More...
#include <murl_math_sphere.h>
A sphere class.
Public Types | |
typedef DataType | ValueType |
The template parameter value type. More... | |
Public Member Functions | |
Sphere () | |
The default constructor. | |
Sphere (const Sphere &s1, const Sphere &s2) | |
Constructor uniting two given spheres. More... | |
Sphere (const Vector< DataType > ¢er, DataType radius) | |
Constructor taking a center position vector and a radius. More... | |
Sphere (DataType centerX, DataType centerY, DataType centerZ, DataType radius) | |
Constructor taking individual center position coordinates and a radius. More... | |
Sphere (const Vector< DataType > &a, const Vector< DataType > &b, const Vector< DataType > &c) | |
Constructor taking the three points of a triangle. More... | |
Sphere (const Box< DataType > &box) | |
Constructor taking a box. More... | |
template<class DataType2 > | |
Sphere (const Sphere< DataType2 > &s) | |
The copy constructor using a sphere of different type. More... | |
void | Clear () |
Clear the sphere. | |
void | Set (const Sphere &other) |
Copy the content of a source sphere to the sphere instance. More... | |
void | Set (const Sphere &s1, const Sphere &s2) |
Unite two spheres to the sphere instance. More... | |
void | Set (const Vector< DataType > ¢er, DataType radius) |
Set a center position vector and a radius. More... | |
void | SetBounding (const Vector< DataType > &a) |
Set the sphere containing a single point. More... | |
void | SetBounding (const Vector< DataType > &a, const Vector< DataType > &b) |
Set the sphere containing two points. More... | |
void | SetBounding (const Vector< DataType > &a, const Vector< DataType > &b, const Vector< DataType > &c) |
Set the sphere using three points lying on the sphere boundary. More... | |
void | SetBounding (const Vector< DataType > &a, const Vector< DataType > &b, const Vector< DataType > &c, const Vector< DataType > &d) |
Set the sphere using four points lying on the sphere boundary. More... | |
void | SetContaining (const Vector< DataType > &a) |
Set the sphere containing a single point. More... | |
void | SetContaining (const Vector< DataType > &a, const Vector< DataType > &b) |
Set the sphere containing two points. More... | |
void | SetContaining (const Vector< DataType > &a, const Vector< DataType > &b, const Vector< DataType > &c) |
Set the sphere containing three points. More... | |
void | SetContaining (const Vector< DataType > *p, UInt32 n) |
Set the sphere containing a number of given points. More... | |
void | Set (const Box< DataType > &box) |
Set the sphere to fit into a box. More... | |
void | SetCenter (const Vector< DataType > ¢er) |
Set the center position. More... | |
const Vector< DataType > & | GetCenter () const |
Get the center position. More... | |
void | SetRadius (DataType radius) |
Set the radius. More... | |
DataType | GetRadius () const |
Get the radius. More... | |
void | Unite (const Sphere &other) |
Unite this sphere with another sphere. More... | |
void | Include (const Vector< DataType > &point) |
Include a point in this sphere. More... | |
Bool | IsIntersecting (const Sphere &other) const |
Check if a given sphere is intersecting this sphere. More... | |
Bool | IsContaining (const Vector< DataType > &p) const |
Check if a given point is inside this sphere. More... | |
Bool | IsEmpty () const |
Check if a the sphere is empty. More... | |
UInt32 | GetFlags () const |
Get the flags. More... | |
String | ToString () const |
Get the string representation of the object. More... | |
Protected Attributes | |
Vector< DataType > | mCenter |
The center position of the sphere. More... | |
DataType | mRadius |
The radius of the sphere. More... | |
UInt32 | mFlags |
Sphere flags. More... | |
typedef DataType Murl::Math::Sphere< DataType >::ValueType |
The template parameter value type.
|
inline |
Constructor uniting two given spheres.
s1 | The first sphere to unite. |
s2 | The second sphere to unite. |
|
inline |
Constructor taking a center position vector and a radius.
center | The center position. |
radius | The radius. |
|
inline |
Constructor taking individual center position coordinates and a radius.
centerX | The center x-position coordinate. |
centerY | The center y-position coordinate. |
centerZ | The center z-position coordinate. |
radius | The radius. |
|
inline |
Constructor taking the three points of a triangle.
a | The first triangle point. |
b | The second triangle point. |
c | The third triangle point. |
|
inline |
Constructor taking a box.
box | The box to fit in. |
|
inline |
The copy constructor using a sphere of different type.
s | The sphere to copy. |
|
inline |
Copy the content of a source sphere to the sphere instance.
other | The sphere to copy from. |
|
inline |
Unite two spheres to the sphere instance.
s1 | The first sphere to unite. |
s2 | The second sphere to unite. |
|
inline |
Set a center position vector and a radius.
center | The center position. |
radius | The radius. |
|
inline |
Set the sphere containing a single point.
The center of the sphere is set to the given point, and the radius to 0.
a | The point. |
|
inline |
Set the sphere containing two points.
The center of the sphere is set to the position at half way between the given points, and the radius to half their distance.
a | The first point. |
b | The second point. |
|
inline |
Set the sphere using three points lying on the sphere boundary.
a | The first point. |
b | The second point. |
c | The third point. |
|
inline |
Set the sphere using four points lying on the sphere boundary.
a | The first point. |
b | The second point. |
c | The third point. |
d | The fourth point. |
|
inline |
Set the sphere containing a single point.
a | The point. |
|
inline |
Set the sphere containing two points.
This is equal to setting the sphere with the given two points lying on the surface of the returned sphere.
a | The first point. |
b | The second point. |
|
inline |
Set the sphere containing three points.
This is different to SetBounding() in that one of the given points may lie inside the returned sphere and not on the boundary.
a | The first point. |
b | The second point. |
c | The third point. |
|
inline |
Set the sphere containing a number of given points.
p | The array of points |
n | The number of points |
|
inline |
Set the sphere to fit into a box.
box | The box to fit in. |
|
inline |
Set the center position.
center | The center position. |
|
inline |
Get the center position.
|
inline |
Set the radius.
radius | The radius. |
|
inline |
Get the radius.
|
inline |
Unite this sphere with another sphere.
other | The other sphere to unite. |
|
inline |
Include a point in this sphere.
point | The point to include. |
|
inline |
Check if a given sphere is intersecting this sphere.
other | The other sphere to check. |
|
inline |
Check if a given point is inside this sphere.
p | The point to check. |
|
inline |
Check if a the sphere is empty.
A sphere is only empty when created with the default constructor, explicitly cleared by calling Clear(), or duplicated from another empty sphere or box. As soon as a single point is included, the sphere is considered "not empty".
|
inline |
Get the flags.
|
inline |
Get the string representation of the object.
|
protected |
The center position of the sphere.
|
protected |
The radius of the sphere.
|
protected |
Sphere flags.