MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnDebugDrawSelected

Method OnDebugDrawSelected

Source/Engine/Level/Actors/SpotLight.cpp:197–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197void 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
225void SpotLight::DrawLightsDebug(RenderView& view)
226{

Callers

nothing calls this directly

Calls 6

GetDirectionFunction · 0.85
OnDebugDrawSelectedFunction · 0.85
GetRightMethod · 0.80
GetUpMethod · 0.80
TanFunction · 0.50
GetPositionFunction · 0.50

Tested by

no test coverage detected