| 26 | static const float DEBUG_BORDER_SIZE = 0.1f; |
| 27 | |
| 28 | Vector3 GetCenterOfAnchors( const PIEveSpaceObject2Vector& anchors ) |
| 29 | { |
| 30 | if( anchors.size() == 0 ) |
| 31 | { |
| 32 | return Vector3( 0, 0, 0 ); |
| 33 | } |
| 34 | else |
| 35 | { |
| 36 | Vector3d center = Vector3d( 0, 0, 0 ); // using doubles because precision. |
| 37 | for( auto it = anchors.begin(); it != anchors.end(); ++it ) |
| 38 | { |
| 39 | Vector3 out; |
| 40 | ( *it )->GetModelCenterWorldPosition( out ); |
| 41 | center += out; |
| 42 | } |
| 43 | center /= (double)anchors.size(); |
| 44 | return Vector3( (float)center.x, (float)center.y, (float)center.z ); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | float GetAnchorsBoundingSphereRadius( const PIEveSpaceObject2Vector& anchors, const Vector3& center ) |
| 49 | { |