Core 1.0
|
Hemispheres. More...
#include <hemisphere.h>
Public Member Functions | |
HemiSphere (const Vector &, const Vector &, const double &) | |
Create a hemi-sphere. More... | |
HemiSphere (const double &) | |
Create a hemi-sphere centered at the origin and with vertical direction. More... | |
~HemiSphere () | |
Empty. | |
Vector | Normal (const Vector &) const |
Compute the distance vector between the hemisphere and a point. More... | |
double | R (const Vector &) const |
Compute the distance between the hemisphere and a point. More... | |
double | Signed (const Vector &) const |
Compute the Euclidean signed distance between the hemisphere and a point. More... | |
Box | GetBox () const |
Compute the bouding box. | |
Vector | Center () const |
Gets the center of a hemisphere. | |
double | Radius () const |
Gets the radius of a hemisphere. | |
Vector | GetAxis () const |
Gets the axis of the hemisphere. | |
Vector | Fibonacci (int, int) |
Compute the i-th Fibonacci direction on the hemisphere. More... | |
Static Public Member Functions | |
static Vector | FibonacciUnit (int, int) |
Compute the i-th Fibonacci direction on the vertical unit hemisphere. More... | |
static Vector | RandomDirection (const Vector &, Random &=Random::R239) |
Generate a random direction. More... | |
Protected Attributes | |
Vector | c = Vector::Null |
Center. | |
double | r = 1.0 |
Radius. | |
Vector | axis = Vector::Z |
Axis. | |
Hemispheres.
Create a hemi-sphere.
c | Center. |
r | Radius. |
a | Axis, should be normalized. |
|
explicit |
Create a hemi-sphere centered at the origin and with vertical direction.
r | Radius. |
Vector HemiSphere::Fibonacci | ( | int | i, |
int | n | ||
) |
Compute the i-th Fibonacci direction on the hemisphere.
i | Point index. |
n | Number of samples on the hemisphere. |
|
static |
Compute the i-th Fibonacci direction on the vertical unit hemisphere.
i | Point index. |
n | Number of samples on the hemisphere. |
Compute the distance vector between the hemisphere and a point.
p | Point. |
double HemiSphere::R | ( | const Vector & | p | ) | const |
Compute the distance between the hemisphere and a point.
p | Point. |
|
static |
Generate a random direction.
axis | Axis. |
random | Random number generator. |
double HemiSphere::Signed | ( | const Vector & | p | ) | const |
Compute the Euclidean signed distance between the hemisphere and a point.
p | Point. |