Fix gizmos debug draw shapes
This commit is contained in:
@@ -450,6 +450,12 @@ namespace FlaxEditor.Viewport
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void DrawEditorPrimitives(GPUContext context, ref RenderContext renderContext, GPUTexture target, GPUTexture targetDepth)
|
public void DrawEditorPrimitives(GPUContext context, ref RenderContext renderContext, GPUTexture target, GPUTexture targetDepth)
|
||||||
{
|
{
|
||||||
|
// Draw gizmos
|
||||||
|
for (int i = 0; i < Gizmos.Count; i++)
|
||||||
|
{
|
||||||
|
Gizmos[i].Draw(ref renderContext);
|
||||||
|
}
|
||||||
|
|
||||||
// Draw selected objects debug shapes and visuals
|
// Draw selected objects debug shapes and visuals
|
||||||
if (DrawDebugDraw && (renderContext.View.Flags & ViewFlags.DebugDraw) == ViewFlags.DebugDraw)
|
if (DrawDebugDraw && (renderContext.View.Flags & ViewFlags.DebugDraw) == ViewFlags.DebugDraw)
|
||||||
{
|
{
|
||||||
@@ -463,12 +469,6 @@ namespace FlaxEditor.Viewport
|
|||||||
|
|
||||||
DebugDraw.Draw(ref renderContext, target.View(), targetDepth.View(), true);
|
DebugDraw.Draw(ref renderContext, target.View(), targetDepth.View(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw gizmos
|
|
||||||
for (int i = 0; i < Gizmos.Count; i++)
|
|
||||||
{
|
|
||||||
Gizmos[i].Draw(ref renderContext);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPostRender(GPUContext context, RenderContext renderContext)
|
private void OnPostRender(GPUContext context, RenderContext renderContext)
|
||||||
|
|||||||
@@ -865,13 +865,13 @@ namespace FlaxEditor.Viewport
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void DrawEditorPrimitives(GPUContext context, ref RenderContext renderContext, GPUTexture target, GPUTexture targetDepth)
|
public override void DrawEditorPrimitives(GPUContext context, ref RenderContext renderContext, GPUTexture target, GPUTexture targetDepth)
|
||||||
{
|
{
|
||||||
base.DrawEditorPrimitives(context, ref renderContext, target, targetDepth);
|
|
||||||
|
|
||||||
// Draw gizmos
|
// Draw gizmos
|
||||||
for (int i = 0; i < Gizmos.Count; i++)
|
for (int i = 0; i < Gizmos.Count; i++)
|
||||||
{
|
{
|
||||||
Gizmos[i].Draw(ref renderContext);
|
Gizmos[i].Draw(ref renderContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
base.DrawEditorPrimitives(context, ref renderContext, target, targetDepth);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -136,8 +136,11 @@ void PointLight::Draw(RenderContext& renderContext)
|
|||||||
|
|
||||||
void PointLight::OnDebugDraw()
|
void PointLight::OnDebugDraw()
|
||||||
{
|
{
|
||||||
// Draw source tube
|
if (SourceRadius > ZeroTolerance || SourceLength > ZeroTolerance)
|
||||||
DEBUG_DRAW_WIRE_TUBE(GetPosition(), GetOrientation(), SourceRadius, SourceLength, Color::Orange, 0, true);
|
{
|
||||||
|
// Draw source tube
|
||||||
|
DEBUG_DRAW_WIRE_TUBE(GetPosition(), GetOrientation(), SourceRadius, SourceLength, Color::Orange, 0, true);
|
||||||
|
}
|
||||||
|
|
||||||
// Base
|
// Base
|
||||||
LightWithShadow::OnDebugDraw();
|
LightWithShadow::OnDebugDraw();
|
||||||
|
|||||||
@@ -184,8 +184,11 @@ void SpotLight::Draw(RenderContext& renderContext)
|
|||||||
|
|
||||||
void SpotLight::OnDebugDraw()
|
void SpotLight::OnDebugDraw()
|
||||||
{
|
{
|
||||||
// Draw source tube
|
if (SourceRadius > ZeroTolerance)
|
||||||
DEBUG_DRAW_WIRE_SPHERE(BoundingSphere(GetPosition(), SourceRadius), Color::Orange, 0, true);
|
{
|
||||||
|
// Draw source tube
|
||||||
|
DEBUG_DRAW_WIRE_SPHERE(BoundingSphere(GetPosition(), SourceRadius), Color::Orange, 0, true);
|
||||||
|
}
|
||||||
|
|
||||||
// Base
|
// Base
|
||||||
LightWithShadow::OnDebugDraw();
|
LightWithShadow::OnDebugDraw();
|
||||||
|
|||||||
Reference in New Issue
Block a user