Improve model bounds debug draw for better depth-readability of occluded pixels
This commit is contained in:
@@ -405,7 +405,7 @@ namespace FlaxEditor.Viewport.Previews
|
||||
// Draw bounds
|
||||
if (_showBounds)
|
||||
{
|
||||
DebugDraw.DrawWireBox(_previewModel.Box, Color.Violet.RGBMultiplied(0.8f), 0, false);
|
||||
DebugDrawBounds(_previewModel.Box);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -224,6 +224,17 @@ namespace FlaxEditor.Viewport.Previews
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the bounds of object.
|
||||
/// </summary>
|
||||
/// <param name="box">Object bounding box.</param>
|
||||
protected void DebugDrawBounds(BoundingBox box)
|
||||
{
|
||||
var color = Color.Violet.RGBMultiplied(0.8f);
|
||||
DebugDraw.DrawWireBox(box, color.AlphaMultiplied(0.3f), 0, false);
|
||||
DebugDraw.DrawWireBox(box, color, 0, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when drawing debug shapes with <see cref="DebugDraw"/> for this viewport.
|
||||
/// </summary>
|
||||
|
||||
@@ -302,7 +302,7 @@ namespace FlaxEditor.Viewport.Previews
|
||||
// Draw bounds
|
||||
if (_showBounds)
|
||||
{
|
||||
DebugDraw.DrawWireBox(_previewModel.Box, Color.Violet.RGBMultiplied(0.8f), 0, false);
|
||||
DebugDrawBounds(_previewModel.Box);
|
||||
}
|
||||
|
||||
// Draw normals
|
||||
|
||||
Reference in New Issue
Block a user