ClothDebugDisplay.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzFramework/Entity/EntityDebugDisplayBus.h>
  10. namespace NvCloth
  11. {
  12. class ClothComponentMesh;
  13. //! Manages the debug display of a ClothComponentMesh.
  14. class ClothDebugDisplay
  15. : protected AzFramework::EntityDebugDisplayEventBus::Handler
  16. {
  17. public:
  18. AZ_TYPE_INFO(ClothDebugDisplay, "{306A2A30-8BB1-4D0F-9776-324CA1D90ABE}");
  19. ClothDebugDisplay(ClothComponentMesh* clothComponentMesh);
  20. ~ClothDebugDisplay();
  21. //! Returns true when any debug cloth information must be displayed.
  22. bool IsDebugDrawEnabled() const;
  23. protected:
  24. // AzFramework::EntityDebugDisplayEventBus::Handler overrides ...
  25. void DisplayEntityViewport(
  26. const AzFramework::ViewportInfo& viewportInfo,
  27. AzFramework::DebugDisplayRequests& debugDisplay) override;
  28. private:
  29. void DisplayParticles(AzFramework::DebugDisplayRequests& debugDisplay);
  30. void DisplayWireCloth(AzFramework::DebugDisplayRequests& debugDisplay);
  31. void DisplayNormals(AzFramework::DebugDisplayRequests& debugDisplay, bool showTangents);
  32. void DisplayColliders(AzFramework::DebugDisplayRequests& debugDisplay);
  33. void DisplayMotionConstraints(AzFramework::DebugDisplayRequests& debugDisplay);
  34. void DisplaySeparationConstraints(AzFramework::DebugDisplayRequests& debugDisplay);
  35. void DrawSphere(AzFramework::DebugDisplayRequests& debugDisplay, float radius, const AZ::Vector3& position, const AZ::Color& color);
  36. void DrawCapsule(AzFramework::DebugDisplayRequests& debugDisplay, float radius, float height, const AZ::Transform& transform, const AZ::Color& color);
  37. ClothComponentMesh* m_clothComponentMesh = nullptr;
  38. };
  39. } // namespace NvCloth