wfmath
1.0.3
A math library for the Worldforge system.
|
A dim dimensional box, lying at an arbitrary angle. More...
#include <rotbox.h>
Public Member Functions | |
RotBox () | |
construct an uninitialized box More... | |
RotBox (const Point< dim > &p, const Vector< dim > &size, const RotMatrix< dim > &orientation) | |
construct a box from the given parameters More... | |
RotBox (const RotBox &b)=default | |
construct a copy of the box More... | |
RotBox (const AtlasInType &a) | |
Construct a rotbox 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... | |
RotBox & | operator= (const RotBox &s)=default |
bool | isEqualTo (const RotBox &b, CoordType epsilon=numeric_constants< CoordType >::epsilon()) const |
bool | operator== (const RotBox &b) const |
bool | operator!= (const RotBox &b) const |
bool | isValid () const |
size_t | numCorners () const |
Point< dim > | getCorner (size_t i) const |
Point< dim > | getCenter () const |
const Point< dim > & | corner0 () const |
returns the base corner of the box More... | |
Point< dim > & | corner0 () |
returns the base corner of the box More... | |
const Vector< dim > & | size () const |
returns the size of the box More... | |
Vector< dim > & | size () |
returns the size of the box More... | |
const RotMatrix< dim > & | orientation () const |
returns the orientation of the box More... | |
RotMatrix< dim > & | orientation () |
returns the orientation of the box More... | |
RotBox & | shift (const Vector< dim > &v) |
RotBox & | moveCornerTo (const Point< dim > &p, size_t corner) |
RotBox & | moveCenterTo (const Point< dim > &p) |
RotBox & | rotateCorner (const RotMatrix< dim > &m, size_t corner) |
RotBox & | rotateCenter (const RotMatrix< dim > &m) |
RotBox & | rotatePoint (const RotMatrix< dim > &m, const Point< dim > &p) |
RotBox & | rotateCorner (const Quaternion &q, size_t corner) |
RotBox & | rotateCenter (const Quaternion &q) |
RotBox & | rotatePoint (const Quaternion &q, const Point< dim > &p) |
AxisBox< dim > | boundingBox () const |
Ball< dim > | boundingSphere () const |
Ball< dim > | boundingSphereSloppy () const |
RotBox | toParentCoords (const Point< dim > &origin, const RotMatrix< dim > &rotation=RotMatrix< dim >().identity()) const |
RotBox | toParentCoords (const AxisBox< dim > &coords) const |
RotBox | toParentCoords (const RotBox< dim > &coords) const |
RotBox | toLocalCoords (const Point< dim > &origin, const RotMatrix< dim > &rotation=RotMatrix< dim >().identity()) const |
RotBox | toLocalCoords (const AxisBox< dim > &coords) const |
RotBox | toLocalCoords (const RotBox< dim > &coords) const |
RotBox | toParentCoords (const Point< dim > &origin, const Quaternion &rotation) const |
RotBox | toLocalCoords (const Point< dim > &origin, const Quaternion &rotation) const |
template<> | |
RotBox< 3 > & | rotatePoint (const Quaternion &q, const Point< 3 > &p) |
template<> | |
RotBox< 3 > & | rotateCorner (const Quaternion &q, size_t corner) |
template<> | |
RotBox< 3 > & | rotateCenter (const Quaternion &q) |
template<> | |
RotBox< 3 > | toParentCoords (const Point< 3 > &origin, const Quaternion &rotation) const |
template<> | |
RotBox< 3 > | toLocalCoords (const Point< 3 > &origin, const Quaternion &rotation) const |
Friends | |
std::ostream & | operator (std::ostream &os, const RotBox &r) |
std::istream & | operator>> (std::istream &is, RotBox &r) |
bool | Intersect (const RotBox &r, const Point< dim > &p, bool proper) |
bool | Contains (const Point< dim > &p, const RotBox &r, bool proper) |
bool | Intersect (const RotBox &r, const AxisBox< dim > &b, bool proper) |
bool | Contains (const RotBox &r, const AxisBox< dim > &b, bool proper) |
bool | Contains (const AxisBox< dim > &b, const RotBox &r, bool proper) |
bool | Intersect (const RotBox &r, const Ball< dim > &b, bool proper) |
bool | Contains (const RotBox &r, const Ball< dim > &b, bool proper) |
bool | Contains (const Ball< dim > &b, const RotBox &r, bool proper) |
bool | Intersect (const RotBox &r, const Segment< dim > &s, bool proper) |
bool | Contains (const RotBox &r, const Segment< dim > &s, bool proper) |
bool | Contains (const Segment< dim > &s, const RotBox &r, bool proper) |
bool | Intersect (const RotBox &r1, const RotBox &r2, bool proper) |
bool | Contains (const RotBox &outer, const RotBox &inner, bool proper) |
bool | Intersect (const Polygon< dim > &p, const RotBox &r, bool proper) |
bool | Contains (const Polygon< dim > &p, const RotBox &r, bool proper) |
bool | Contains (const RotBox &r, const Polygon< dim > &p, bool proper) |
A dim dimensional box, lying at an arbitrary angle.
This class implements the full shape interface, as described in the fake class Shape.
|
inline |
construct an uninitialized box
Definition at line 50 of file rotbox.h.
Referenced by WFMath::RotBox< dim >::orientation(), and WFMath::RotBox< dim >::RotBox().
|
inline |
construct a box from the given parameters
p gives corner 0 of the box, size gives the offset from corner 0 to the opposite corner (corner 2^dim - 1), orientation gives the rotation of the box relative to the coordinate axes
Definition at line 57 of file rotbox.h.
References WFMath::RotBox< dim >::fromAtlas(), WFMath::Prod(), WFMath::RotBox< dim >::RotBox(), and WFMath::RotBox< dim >::toAtlas().
|
default |
construct a copy of the box
|
inlineexplicit |
Construct a rotbox from an object passed by Atlas.
Definition at line 490 of file atlasconv.h.
References WFMath::Ball< dim >::fromAtlas().
|
inline |
|
inline |
|
inline |
Set the box's value to that given by an Atlas object.
Definition at line 452 of file atlasconv.h.
References WFMath::Point< dim >::fromAtlas(), and WFMath::Vector< dim >::fromAtlas().
Referenced by WFMath::RotBox< dim >::RotBox().
|
inline |
|
inline |
returns the orientation of the box
Definition at line 102 of file rotbox.h.
References WFMath::Prod(), and WFMath::RotBox< dim >::RotBox().
|
inline |
|
inline |
|
inline |
Create an Atlas object from the box.
Definition at line 480 of file atlasconv.h.
Referenced by WFMath::RotBox< dim >::RotBox().