|
Core 1.0
|
Intersection between a cone and a sphere. More...
#include <sector.h>
Public Member Functions | |
| Sector () | |
| Empty. | |
| Sector (const double &, const double &=Math::HalfPi) | |
| Creates a sector. | |
| Sector (const Vector &, const Vector &, const double &, const double &=Math::HalfPi) | |
| Creates a sector. | |
| ~Sector () | |
| Empty. | |
| double | Signed (const Vector &) const |
| Compute the signed Euclidean distance between a point and a sector. | |
| void | Rotate (const Matrix &) |
| Rotates a sector. | |
| void | Translate (const Vector &) |
| Translates a sector. | |
| void | Scale (const double &) |
| Uniformly scales a sector. | |
| Box | GetBox () const |
| Compute the axis aligned bounding box of a sector. | |
Protected Attributes | |
| Vector | c = Vector::Null |
| Center of the sector. | |
| Vector | axis = Vector::Z |
| Axis. | |
| double | a = Math::Pi / 4.0 |
| Angle. | |
| Vector2 | s = Vector2(Math::InvSqrt2, Math::InvSqrt2) |
| Sine and cosine of the sector angle. | |
| double | r = 1.0 |
| Radius. | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const Sector §or) |
| Overloaded. | |
Intersection between a cone and a sphere.
|
explicit |
Creates a sector.
| r | Radius. |
| a | Angle. |
|
explicit |
Creates a sector.
| c | Center. |
| axis | Axis, which should be normalized. |
| r | Radius. |
| a | Angle. |
| Box Sector::GetBox | ( | ) | const |
Compute the axis aligned bounding box of a sector.
The box is the one of a cylinder of axis the axis of the sector. The sector is inside the half space in front of the plane through the center if the angle is not larger than \( \pi/2 \), otherwise it extends behind this plane down to the distance \( r \cos a \) along the axis. The radius of the cylinder is the largest distance to the axis, which is r for an angle larger than \( \pi/2 \) and \( r \sin a \) otherwise.
| void Sector::Rotate | ( | const Matrix & | r | ) |
Rotates a sector.
| r | Rotation matrix. |
| void Sector::Scale | ( | const double & | s | ) |
Uniformly scales a sector.
| s | Scaling factor. |
| double Sector::Signed | ( | const Vector & | p | ) | const |
Compute the signed Euclidean distance between a point and a sector.
| p | Point. |
| void Sector::Translate | ( | const Vector & | t | ) |
Translates a sector.
| t | Translation vector. |
|
friend |
Overloaded.
| s | Stream. |
| sector | The sector. |