| 111 | } |
| 112 | |
| 113 | Vector3 Tr2SolidSet::GetCenterOfMass( void ) |
| 114 | { |
| 115 | Vector3 result = Vector3( 0.0f, 0.0f, 0.0f ); |
| 116 | for( unsigned int i = 0; i < m_triangles.size(); i++ ) |
| 117 | { |
| 118 | result.x += m_triangles[i].m_position1.x; |
| 119 | result.x += m_triangles[i].m_position2.x; |
| 120 | result.x += m_triangles[i].m_position3.x; |
| 121 | result.y += m_triangles[i].m_position1.y; |
| 122 | result.y += m_triangles[i].m_position2.y; |
| 123 | result.y += m_triangles[i].m_position3.y; |
| 124 | result.z += m_triangles[i].m_position1.z; |
| 125 | result.z += m_triangles[i].m_position2.z; |
| 126 | result.z += m_triangles[i].m_position3.z; |
| 127 | } |
| 128 | |
| 129 | result.x /= ( m_triangles.size() * 3 ); |
| 130 | result.y /= ( m_triangles.size() * 3 ); |
| 131 | result.z /= ( m_triangles.size() * 3 ); |
| 132 | result = TransformCoord( result, m_worldTransform ); |
| 133 | return result; |
| 134 | } |
| 135 | |
| 136 | |
| 137 | void Tr2SolidSet::GetBatchesImpl( ITriRenderBatchAccumulator* accumulator, const Tr2PerObjectData* perObjectData, Tr2Material* effect, GetBatchesReason reason ) |
no test coverage detected