MCPcopy Create free account
hub / github.com/carbonengine/trinity / RenderDebugInfo

Method RenderDebugInfo

trinity/Lights/Tr2SpotLight.cpp:16–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16void Tr2SpotLight::RenderDebugInfo( ITr2DebugRenderer2& renderer, const Matrix& worldMatrix, const Float4x3* bones, size_t boneCount )
17{
18 auto baseColor = m_lightData.color * m_lightData.brightness;
19 baseColor.a = 0.025f;
20 auto colorMod = Color( 0.0f, 0.0f, 0.0f, 0.025f );
21
22 Matrix boneMatrix = m_boneTransform;
23 if( m_lightData.boneIndex >= 0 && m_lightData.boneIndex < boneCount )
24 {
25 TriMatrixCopyFrom3x4( &boneMatrix, &bones[m_lightData.boneIndex] );
26 }
27
28 Matrix lightMatrix = RotationMatrix( m_lightData.rotation ) * TranslationMatrix( m_lightData.position ) * boneMatrix * worldMatrix;
29
30 float outerAngle = TRI_2PI * m_lightData.outerAngle / 360.f;
31 float innerAngle = TRI_2PI * m_lightData.innerAngle / 360.f;
32
33 renderer.DrawCone( this, lightMatrix, m_lightData.radius, outerAngle, 15, 15, Tr2DebugRenderer::Solid, Tr2DebugColor( baseColor + colorMod * 2.0f, baseColor ) );
34 renderer.DrawCone( this, lightMatrix, m_lightData.innerRadius, innerAngle, 15, 15, Tr2DebugRenderer::Solid, Tr2DebugColor( baseColor + colorMod * 3.0f, baseColor + colorMod ) );
35}

Callers

nothing calls this directly

Calls 3

TriMatrixCopyFrom3x4Function · 0.85
Tr2DebugColorClass · 0.85
DrawConeMethod · 0.45

Tested by

no test coverage detected