Merge branch 'Tryibion-prefab-debug-draw'

This commit is contained in:
Wojtek Figat
2024-08-05 18:21:32 +02:00
3 changed files with 20 additions and 0 deletions

View File

@@ -623,6 +623,14 @@ namespace FlaxEditor.Viewport
DebugDraw.DrawActors(new IntPtr(actors), _debugDrawData.ActorsCount, false);
}
}
// Debug draw all actors in prefab
foreach (var child in SceneGraphRoot.ChildNodes)
{
if (child is not ActorNode actorNode)
continue;
DebugDraw.DrawActorsTree(actorNode.Actor);
}
}
}
}

View File

@@ -944,6 +944,12 @@ void DebugDraw::DrawActors(Actor** selectedActors, int32 selectedActorsCount, bo
}
}
void DebugDraw::DrawActorsTree(Actor* actor)
{
Function<bool(Actor*)> function = &DrawActorsTreeWalk;
actor->TreeExecute(function);
}
void DebugDraw::DrawAxisFromDirection(const Vector3& origin, const Vector3& direction, float size, float duration, bool depthTest)
{
ASSERT(direction.IsNormalized());

View File

@@ -67,6 +67,12 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw
/// <param name="drawScenes">True if draw all debug shapes from scenes too or false if draw just from specified actor list.</param>
API_FUNCTION() static void DrawActors(Actor** selectedActors, int32 selectedActorsCount, bool drawScenes);
/// <summary>
/// Draws the debug shapes for the given actor and the actor's children
/// </summary>
/// /// <param name="actor">The actor to start drawing at.</param>
API_FUNCTION() static void DrawActorsTree(Actor* actor);
/// <summary>
/// Draws the lines axis from direction.
/// </summary>