DebugDraw gem fixes for Atom (#885)

* Work in progress on adapting the DebugDraw gem to use AzFramework::DebugDisplayRequests API

* Cleanup fixes for DebugDisplayRequestBus & DebugDraw gem.

Remove SandboxIntegration implementation of the DebugDisplayRequestBus
Add DrawWireCylinder & DrawWireCone to the DebugDisplayRequestBus interface
Remove SetFillMode & DrawTexture functions from the DebugDisplayRequestBus interface
Fixup uses of the SetFillMode api, replace with new Draw[Wire|Solid]X functions.
Fixes to the DebugDraw gem to get it compiling with new warnings settings.

* Changes to get the DebugDraw gem working with Atom/RHI/Code/Include/Atom/RHI

Add GetWidth, GetHeight, GetDepth utility accessors to RHI::Viewport
Start cleaning out unnecessary Cry includes from DebugDraw gem
Fixes for AtomFont FFont.cpp 3d screen aligned text drawing.
Clean out no longer supported code for 3d text to render multiple strings for the same entity location

* Cleanup some unused or commented code

* Update with PR feedback from Nick Van Sickle
This commit is contained in:
rgba16f
2021-05-24 16:49:00 -05:00
committed by GitHub
parent 503848632c
commit d4bad61f9a
14 changed files with 180 additions and 907 deletions
@@ -32,6 +32,9 @@
#include <AzToolsFramework/Entity/EditorEntityContextBus.h>
#endif // DEBUGDRAW_GEM_EDITOR
#include <Atom/RPI.Public/SceneBus.h>
#include <Atom/Bootstrap/BootstrapNotificationBus.h>
namespace DebugDraw
{
// DebugDraw elements that don't have corresponding component representations yet
@@ -61,10 +64,11 @@ namespace DebugDraw
class DebugDrawSystemComponent
: public AZ::Component
, public AZ::TickBus::Handler
, public AZ::EntityBus::MultiHandler
, protected DebugDrawRequestBus::Handler
, protected DebugDrawInternalRequestBus::Handler
, public AZ::RPI::SceneNotificationBus::Handler
, public AZ::Render::Bootstrap::NotificationBus::Handler
#ifdef DEBUGDRAW_GEM_EDITOR
, protected AzToolsFramework::EditorEntityContextNotificationBus::Handler
@@ -113,20 +117,22 @@ namespace DebugDraw
void Activate() override;
void Deactivate() override;
// TickBus
void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
int GetTickOrder() override { return AZ::ComponentTickBus::TICK_DEFAULT; }
// SceneNotificationBus
void OnBeginPrepareRender() override;
// AZ::Render::Bootstrap::NotificationBus
void OnBootstrapSceneReady(AZ::RPI::Scene* scene);
// EntityBus
void OnEntityDeactivated(const AZ::EntityId& entityId) override;
// Ticking functions for drawing debug elements
void OnTickAabbs();
void OnTickLines();
void OnTickObbs();
void OnTickRays();
void OnTickSpheres();
void OnTickText();
void OnTickAabbs(AzFramework::DebugDisplayRequests& debugDisplay);
void OnTickLines(AzFramework::DebugDisplayRequests& debugDisplay);
void OnTickObbs(AzFramework::DebugDisplayRequests& debugDisplay);
void OnTickRays(AzFramework::DebugDisplayRequests& debugDisplay);
void OnTickSpheres(AzFramework::DebugDisplayRequests& debugDisplay);
void OnTickText(AzFramework::DebugDisplayRequests& debugDisplay);
// Element creation functions, used when DebugDraw components register themselves
void CreateAabbEntryForComponent(const AZ::EntityId& componentEntityId, const DebugDrawAabbElement& element);
@@ -154,7 +160,7 @@ namespace DebugDraw
double m_currentTime;
AZStd::vector<Vec3> m_batchPoints;
AZStd::vector<ColorB> m_batchColors;
AZStd::vector<AZ::Vector3> m_batchPoints;
AZStd::vector<AZ::Color> m_batchColors;
};
}