Add Physics Colliders debug view mode to display physical world shapes (solid)

This commit is contained in:
Wojtek Figat
2021-07-14 14:49:41 +02:00
parent 151b478a97
commit 04c6ecc963
13 changed files with 69 additions and 18 deletions

View File

@@ -25,11 +25,14 @@ void BoxCollider::SetSize(const Vector3& value)
#if USE_EDITOR
#include "Engine/Debug/DebugDraw.h"
#include "Engine/Graphics/RenderView.h"
void BoxCollider::DrawPhysicsDebug(RenderView& view)
{
const Color color = Color::GreenYellow;
DEBUG_DRAW_WIRE_BOX(_bounds, color * 0.8f, 0, true);
if (view.Mode == ViewMode::PhysicsColliders && !GetIsTrigger())
DebugDraw::DrawBox(_bounds, _staticActor ? Color::CornflowerBlue : Color::Orchid, 0, true);
else
DebugDraw::DrawWireBox(_bounds, Color::GreenYellow * 0.8f, 0, true);
}
void BoxCollider::OnDebugDraw()