devel/CSGLib/src/Solid.cpp
/**
 * Gets the solid mean
 * 
 * @return point representing the mean
 */
Gets the solid mean

@return point representing the mean
Gets the solid mean @return point representing the mean
mlVector3D Solid::getMean()
{
	mlVector3D mean;
	for(int i=0;i<vertices.length;i++)
	{
		mean.x += vertices[i].x;
		mean.y += vertices[i].y;
		mean.z += vertices[i].z;
	}
	mean.x /= vertices.length;
	mean.y /= vertices.length;
	mean.z /= vertices.length;
	return mean;
}
mlVector3D Solid :: getMean ( ) { mlVector3D mean ; for ( int i = 0 ; i < vertices . length ; i ++ ) { mean . x += vertices [ i ] . x ; mean . y += vertices [ i ] . y ; mean . z += vertices [ i ] . z ; } mean . x /= vertices . length ; mean . y /= vertices . length ; mean . z /= vertices . length ; return mean ; }
Gets the solid mean
Gets the solid mean