| 173 | } |
| 174 | |
| 175 | void EveTransform::RenderDebugInfo( ITr2DebugRenderer2& renderer ) |
| 176 | { |
| 177 | // is this one here enabled? |
| 178 | if( m_hideOnLowQuality && Tr2Renderer::IsLowQuality() ) |
| 179 | { |
| 180 | return; |
| 181 | } |
| 182 | |
| 183 | if( !m_isVisible ) |
| 184 | { |
| 185 | return; |
| 186 | } |
| 187 | |
| 188 | for( auto it = m_observers.begin(); it != m_observers.end(); ++it ) |
| 189 | { |
| 190 | ( *it )->RenderDebugInfo( renderer ); |
| 191 | } |
| 192 | |
| 193 | |
| 194 | if( renderer.HasOption( this, "Bounding Box" ) ) |
| 195 | { |
| 196 | Vector3 minBounds( -0.5f, -0.5f, -0.5f ); |
| 197 | Vector3 maxBounds( 0.5f, 0.5f, 0.5f ); |
| 198 | uint32_t color = 0xff0000ff; |
| 199 | if( m_overrideBoundsMax.x != m_overrideBoundsMin.x || m_overrideBoundsMax.y != m_overrideBoundsMin.y || m_overrideBoundsMax.z != m_overrideBoundsMin.z ) |
| 200 | { |
| 201 | minBounds = m_overrideBoundsMin; |
| 202 | maxBounds = m_overrideBoundsMax; |
| 203 | color = 0xffffffff; |
| 204 | } |
| 205 | else if( m_mesh && m_mesh->GetBoundingBox( minBounds, maxBounds ) ) |
| 206 | { |
| 207 | color = 0xffffffff; |
| 208 | } |
| 209 | renderer.DrawBox( this, m_worldTransform, minBounds, maxBounds, Tr2DebugRenderer::Wireframe, color ); |
| 210 | } |
| 211 | if( renderer.HasOption( this, "Bounding Sphere" ) ) |
| 212 | { |
| 213 | Vector4 sphere; |
| 214 | if( GetBoundingSphere( sphere ) ) |
| 215 | { |
| 216 | renderer.DrawSphere( this, Vector3( sphere.x, sphere.x, sphere.x ), sphere.w, 10, Tr2DebugRenderer::Wireframe, 0xff808000 ); |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | if( renderer.HasOption( this, "Names" ) ) |
| 221 | { |
| 222 | Vector3 minBounds( -0.5f, -0.5f, -0.5f ); |
| 223 | Vector3 maxBounds( 0.5f, 0.5f, 0.5f ); |
| 224 | if( m_mesh ) |
| 225 | { |
| 226 | m_mesh->GetBoundingBox( minBounds, maxBounds ); |
| 227 | } |
| 228 | renderer.DrawText( TRI_DBG_FONT_SMALL, maxBounds, 0xffffffff, m_name.c_str() ); |
| 229 | } |
| 230 | |
| 231 | if( m_mesh ) |
| 232 | { |
nothing calls this directly
no test coverage detected