This class computes the main axis for a point cloud by a principal component analysis.
void computeMainAxis(const std::vector< Vector3 > &points)
Computes the main axes on behalf of the given point cloud.
void getMainAxis(Vector3 &longestAxis, Vector3 &midAxis, Vector3 &shortestAxis) const
Returns the main axes (normalized). The axes are sorted by extent, largest first.
void getExtension(float &longestExtent, float &midExtent, float &shortestExtent) const
Returns the three extents of the object aligned bounding box, largest first.
Vector3 getLargestMainAxis() const
Returns a copy of the largest main axis.
float getLargestExtension() const
Returns the largest extend of the object aligned bounding box.
Vector3 getMidPoint() const
Returns the middle point of the object aligned bounding box.
Vector3 getCenterOfMass() const
Returns the center of mass of the object, which is the mean of all 3d points.