Fix gizmos debug draw shapes

This commit is contained in:
Wojtek Figat
2021-06-01 14:38:24 +02:00
parent accbef6841
commit c30e338f0a
4 changed files with 18 additions and 12 deletions

View File

@@ -136,8 +136,11 @@ void PointLight::Draw(RenderContext& renderContext)
void PointLight::OnDebugDraw()
{
// Draw source tube
DEBUG_DRAW_WIRE_TUBE(GetPosition(), GetOrientation(), SourceRadius, SourceLength, Color::Orange, 0, true);
if (SourceRadius > ZeroTolerance || SourceLength > ZeroTolerance)
{
// Draw source tube
DEBUG_DRAW_WIRE_TUBE(GetPosition(), GetOrientation(), SourceRadius, SourceLength, Color::Orange, 0, true);
}
// Base
LightWithShadow::OnDebugDraw();

View File

@@ -184,8 +184,11 @@ void SpotLight::Draw(RenderContext& renderContext)
void SpotLight::OnDebugDraw()
{
// Draw source tube
DEBUG_DRAW_WIRE_SPHERE(BoundingSphere(GetPosition(), SourceRadius), Color::Orange, 0, true);
if (SourceRadius > ZeroTolerance)
{
// Draw source tube
DEBUG_DRAW_WIRE_SPHERE(BoundingSphere(GetPosition(), SourceRadius), Color::Orange, 0, true);
}
// Base
LightWithShadow::OnDebugDraw();