wfmath
1.0.3
A math library for the Worldforge system.
|
30 #ifndef WFMATH_SHAPE_H
31 #define WFMATH_SHAPE_H
33 #include <wfmath/vector.h>
34 #include <wfmath/point.h>
35 #include <wfmath/const.h>
36 #include <wfmath/rotmatrix.h>
37 #include <wfmath/axisbox.h>
38 #include <wfmath/ball.h>
39 #include <wfmath/intersect_decls.h>
55 template<const
int dim>
70 friend std::ostream& operator<< <dim>(std::ostream& os,
const Shape& s);
72 friend std::istream&
operator>> <dim>(std::istream& is,
Shape& s);
190 #endif // WFMATH_SHAPE_H
bool operator==(const Shape &s) const
generic: check if two classes are equal, up to tolerance WFMATH_EPSILON
Ball< dim > boundingSphere() const
shape: return the minimal bounding sphere
Ball< dim > boundingSphereSloppy() const
bool isEqualTo(const Shape &s, CoordType tolerance=numeric_constants< CoordType >::epsilon()) const
generic: check if two classes are equal, up to a given tolerance
Shape & rotateCorner(const RotMatrix< dim > &m, size_t corner)
shape: rotate the shape while holding the given corner fixed
Shape & moveCornerTo(const Point< dim > &p, size_t corner)
shape: move the shape, moving the given corner to the Point p
bool isValid() const
generic: returns true if the class instance has been initialized
A dim dimensional rotation matrix. Technically, a member of the group O(dim).
Shape & shift(const Vector< dim > &v)
shape: move the shape by an amount given by the Vector v
bool operator!=(const Shape &s) const
generic: check if two classes are not equal, up to tolerance WFMATH_EPSILON
Point< dim > getCenter() const
shape: return the position of the center of the shape
AxisBox< dim > boundingBox() const
shape: return the minimal axis-aligned bounding box
Generic library namespace.
A dim dimensional axis-aligned box.
A dim dimensional vector.
Shape & rotateCenter(const RotMatrix< dim > &m)
shape: rotate the shape while holding the center fixed
Shape & rotatePoint(const RotMatrix< dim > &m, const Point< dim > &p)
shape: rotate the shape while holding the Point p fixed.
A fake class which documents the generic parts of the WFMath interface.
double CoordType
Basic floating point type.
Shape & moveCenterTo(const Point< dim > &p)
shape: move the shape, moving the center to the Point p
Point< dim > getCorner(size_t i) const
shape: return the position of the i'th corner, where 0 <= i < numCorners()
size_t numCorners() const
shape: return the number of corners in the shape.