#ifndef __CONVEXHULL_H__ #define __CONVEXHULL_H__ #include #include "vector3.h" class ConvexHull { public: ConvexHull(); static ConvexHull add(const ConvexHull& ca, const ConvexHull& cb); void updateHull(const Geometry::Vector3Df& last); void updateHull(const ConvexHull& ch); ConvexHull& operator=(const ConvexHull& ch); int size() { return _hull.size(); } bool empty() { return _hull.empty(); } void clear() { _hull.clear(); } float diameter(); float perimeter(); protected: inline Geometry::Vector3Df center(const Geometry::Vector3Df& point) const; std::vector _hull; std::vector _centeredHull; Geometry::Vector3Df _sum, _offset; }; #endif