Fix debug drawing wheeled vehicle in prefab viewport

#3591
This commit is contained in:
Wojtek Figat
2025-08-29 21:03:44 +02:00
parent 5222f1d35c
commit 9fafb47abb
22 changed files with 102 additions and 100 deletions

View File

@@ -30,6 +30,7 @@
#include "Editor/Editor.h"
#include "Engine/Level/Actors/Light.h"
#include "Engine/Physics/Colliders/Collider.h"
#include "Engine/Physics/Actors/IPhysicsDebug.h"
#endif
// Debug draw service configuration
@@ -1027,11 +1028,12 @@ void DebugDraw::DrawActorsTree(Actor* actor)
#if USE_EDITOR
void DebugDraw::DrawColliderDebugPhysics(Collider* collider, RenderView& view)
void DebugDraw::DrawDebugPhysics(Actor* actor, RenderView& view)
{
if (!collider)
if (!actor || !actor->IsActiveInHierarchy())
return;
collider->DrawPhysicsDebug(view);
if (auto* physicsDebug = dynamic_cast<IPhysicsDebug*>(actor))
physicsDebug->DrawPhysicsDebug(view);
}
void DebugDraw::DrawLightDebug(Light* light, RenderView& view)

View File

@@ -102,11 +102,11 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw
#if USE_EDITOR
/// <summary>
/// Draws the physics debug shapes for the given collider. Editor Only
/// Draws the physics debug shapes for the given actor. Editor Only
/// </summary>
/// <param name="collider">The collider to draw.</param>
/// <param name="actor">The actor to draw.</param>
/// <param name="view">The render view to draw in.</param>
API_FUNCTION() static void DrawColliderDebugPhysics(Collider* collider, RenderView& view);
API_FUNCTION() static void DrawDebugPhysics(Actor* actor, RenderView& view);
/// <summary>
/// Draws the light debug shapes for the given light. Editor Only