| 195 | } |
| 196 | |
| 197 | void SpotLight::OnDebugDrawSelected() |
| 198 | { |
| 199 | const auto color = Color::Yellow; |
| 200 | Vector3 right = _transform.GetRight(); |
| 201 | Vector3 up = _transform.GetUp(); |
| 202 | Vector3 forward = GetDirection(); |
| 203 | float radius = GetScaledRadius(); |
| 204 | float discRadius = radius * Math::Tan(_outerConeAngle * DegreesToRadians); |
| 205 | float falloffDiscRadius = radius * Math::Tan(_innerConeAngle * DegreesToRadians); |
| 206 | Vector3 position = GetPosition(); |
| 207 | |
| 208 | DEBUG_DRAW_LINE(position, position + forward * radius + up * discRadius, color, 0, true); |
| 209 | DEBUG_DRAW_LINE(position, position + forward * radius - up * discRadius, color, 0, true); |
| 210 | DEBUG_DRAW_LINE(position, position + forward * radius + right * discRadius, color, 0, true); |
| 211 | DEBUG_DRAW_LINE(position, position + forward * radius - right * discRadius, color, 0, true); |
| 212 | |
| 213 | DEBUG_DRAW_LINE(position, position + forward * radius + up * falloffDiscRadius, color * 0.6f, 0, true); |
| 214 | DEBUG_DRAW_LINE(position, position + forward * radius - up * falloffDiscRadius, color * 0.6f, 0, true); |
| 215 | DEBUG_DRAW_LINE(position, position + forward * radius + right * falloffDiscRadius, color * 0.6f, 0, true); |
| 216 | DEBUG_DRAW_LINE(position, position + forward * radius - right * falloffDiscRadius, color * 0.6f, 0, true); |
| 217 | |
| 218 | DEBUG_DRAW_CIRCLE(position + forward * radius, forward, discRadius, color, 0, true); |
| 219 | DEBUG_DRAW_CIRCLE(position + forward * radius, forward, falloffDiscRadius, color * 0.6f, 0, true); |
| 220 | |
| 221 | // Base |
| 222 | LightWithShadow::OnDebugDrawSelected(); |
| 223 | } |
| 224 | |
| 225 | void SpotLight::DrawLightsDebug(RenderView& view) |
| 226 | { |
nothing calls this directly
no test coverage detected