wfmath
1.0.3
A math library for the Worldforge system.
|
A dim dimensional ball. More...
#include <ball.h>
Public Member Functions | |
Ball () | |
construct an uninitialized ball More... | |
Ball (const Point< dim > ¢er, CoordType radius) | |
construct a ball with the given center and radius More... | |
Ball (const Ball &b)=default | |
construct a copy of a ball More... | |
Ball (const AtlasInType &a) | |
Construct a ball from an object passed by Atlas. More... | |
AtlasOutType | toAtlas () const |
Create an Atlas object from the box. More... | |
void | fromAtlas (const AtlasInType &a) |
Set the box's value to that given by an Atlas object. More... | |
Ball & | operator= (const Ball &b)=default |
bool | isEqualTo (const Ball &b, CoordType epsilon=numeric_constants< CoordType >::epsilon()) const |
bool | operator== (const Ball &b) const |
bool | operator!= (const Ball &b) const |
bool | isValid () const |
size_t | numCorners () const |
Point< dim > | getCorner (size_t) const |
Point< dim > | getCenter () const |
const Point< dim > & | center () const |
get the center of the ball More... | |
Point< dim > & | center () |
get the center of the ball More... | |
CoordType | radius () const |
get the radius of the ball More... | |
CoordType & | radius () |
get the radius of the ball More... | |
Ball & | shift (const Vector< dim > &v) |
Ball & | moveCornerTo (const Point< dim > &, size_t) |
Ball & | moveCenterTo (const Point< dim > &p) |
Ball & | rotateCorner (const RotMatrix< dim > &, size_t) |
Ball & | rotateCenter (const RotMatrix< dim > &) |
Ball & | rotatePoint (const RotMatrix< dim > &m, const Point< dim > &p) |
Ball & | rotateCorner (const Quaternion &, size_t corner) |
Ball & | rotateCenter (const Quaternion &) |
Ball & | rotatePoint (const Quaternion &q, const Point< dim > &p) |
AxisBox< dim > | boundingBox () const |
Ball | boundingSphere () const |
Ball | boundingSphereSloppy () const |
Ball | toParentCoords (const Point< dim > &origin, const RotMatrix< dim > &rotation=RotMatrix< dim >().identity()) const |
Ball | toParentCoords (const AxisBox< dim > &coords) const |
Ball | toParentCoords (const RotBox< dim > &coords) const |
Ball | toLocalCoords (const Point< dim > &origin, const RotMatrix< dim > &rotation=RotMatrix< dim >().identity()) const |
Ball | toLocalCoords (const AxisBox< dim > &coords) const |
Ball | toLocalCoords (const RotBox< dim > &coords) const |
Ball | toParentCoords (const Point< dim > &origin, const Quaternion &rotation) const |
Ball | toLocalCoords (const Point< dim > &origin, const Quaternion &rotation) const |
template<> | |
Ball< 3 > & | rotateCorner (const Quaternion &, size_t) |
template<> | |
Ball< 3 > & | rotateCenter (const Quaternion &) |
template<> | |
Ball< 3 > & | rotatePoint (const Quaternion &q, const Point< 3 > &p) |
template<> | |
Ball< 3 > | toParentCoords (const Point< 3 > &origin, const Quaternion &rotation) const |
template<> | |
Ball< 3 > | toLocalCoords (const Point< 3 > &origin, const Quaternion &rotation) const |
Friends | |
std::ostream & | operator (std::ostream &os, const Ball &b) |
std::istream & | operator>> (std::istream &is, Ball &b) |
bool | Intersect (const Ball &b, const Point< dim > &p, bool proper) |
bool | Contains (const Point< dim > &p, const Ball &b, bool proper) |
bool | Intersect (const Ball &b, const AxisBox< dim > &a, bool proper) |
bool | Contains (const Ball &b, const AxisBox< dim > &a, bool proper) |
bool | Contains (const AxisBox< dim > &a, const Ball &b, bool proper) |
bool | Intersect (const Ball &b1, const Ball &b2, bool proper) |
bool | Contains (const Ball &outer, const Ball &inner, bool proper) |
bool | Intersect (const Segment< dim > &s, const Ball &b, bool proper) |
bool | Contains (const Segment< dim > &s, const Ball &b, bool proper) |
bool | Intersect (const RotBox< dim > &r, const Ball &b, bool proper) |
bool | Contains (const RotBox< dim > &r, const Ball &b, bool proper) |
bool | Contains (const Ball &b, const RotBox< dim > &r, bool proper) |
bool | Intersect (const Polygon< dim > &p, const Ball &b, bool proper) |
bool | Contains (const Polygon< dim > &p, const Ball &b, bool proper) |
bool | Contains (const Ball &b, const Polygon< dim > &p, bool proper) |
A dim dimensional ball.
This class implements the full shape interface, as described in the fake class Shape.
This class is called Ball<> instead of Sphere to be more in tune with the usual mathematical naming conventions, where a ball is a filled object, while a sphere is just the outer shell. It also helps that a Ball<n> corresponds to an n-ball, while a Sphere<n> would correspond to an (n-1)-sphere.
|
inline |
construct an uninitialized ball
Definition at line 64 of file ball.h.
Referenced by WFMath::Ball< dim >::Ball(), and WFMath::Ball< dim >::radius().
|
inline |
construct a ball with the given center and radius
Definition at line 66 of file ball.h.
References WFMath::Ball< dim >::Ball(), WFMath::Ball< dim >::fromAtlas(), and WFMath::Ball< dim >::toAtlas().
|
default |
construct a copy of a ball
|
inlineexplicit |
Construct a ball from an object passed by Atlas.
Definition at line 318 of file atlasconv.h.
References WFMath::Ball< dim >::fromAtlas(), WFMath::Point< dim >::x(), WFMath::Point< dim >::y(), and WFMath::Point< dim >::z().
|
inline |
|
inline |
|
inline |
Set the box's value to that given by an Atlas object.
Definition at line 280 of file atlasconv.h.
Referenced by WFMath::Ball< dim >::Ball(), WFMath::RotBox< dim >::RotBox(), and WFMath::Line< dim >::toAtlas().
|
inline |
|
inline |
get the radius of the ball
Definition at line 109 of file ball.h.
References WFMath::Ball< dim >::Ball().
|
inline |
Create an Atlas object from the box.
Definition at line 309 of file atlasconv.h.
Referenced by WFMath::Ball< dim >::Ball().