RecastNavigationMeshConfig.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 <AzCore/Component/ComponentBus.h>
  10. #include <AzCore/RTTI/RTTI.h>
  11. #include <AzCore/Serialization/EditContext.h>
  12. namespace RecastNavigation
  13. {
  14. //! See @rcConfig from Recast library for documentation on these parameters.
  15. //! @Reflect method provides that documentation as tooltips in the Editor.
  16. //!
  17. //! @note Pay attention to the units of the properties in this configuration,
  18. //! some of them are in world units (regular O3DE world space) and others are
  19. //! in Recast voxels, which are defined by @m_cellSize. 1 voxel = 1 @m_cellSize in world units.
  20. class RecastNavigationMeshConfig final
  21. : public AZ::ComponentConfig
  22. {
  23. public:
  24. AZ_CLASS_ALLOCATOR(RecastNavigationMeshConfig, AZ::SystemAllocator)
  25. AZ_RTTI(RecastNavigationMeshConfig, "{472141BB-7C36-4D2C-A508-78DB0D3C07F2}");
  26. static void Reflect(AZ::ReflectContext* context);
  27. float m_tileSize = 32.f;
  28. int m_borderSize = 20;
  29. float m_cellSize = 0.4f;
  30. float m_cellHeight = 0.4f;
  31. float m_agentMaxSlope = 45.0f;
  32. float m_agentHeight = 2.0f;
  33. float m_agentRadius = 0.6f;
  34. float m_agentMaxClimb = 0.9f;
  35. float m_edgeMaxError = 1.3f;
  36. float m_edgeMaxLen = 12.0f;
  37. int m_maxVerticesPerPoly = 6;
  38. float m_detailSampleDist = 6.0f;
  39. float m_detailSampleMaxError = 1.0f;
  40. int m_regionMinSize = 8;
  41. int m_regionMergeSize = 20;
  42. bool m_filterLowHangingObstacles = true;
  43. bool m_filterLedgeSpans = true;
  44. bool m_filterWalkableLowHeightSpans = true;
  45. //! If enabled, draw the navigation mesh in the game.
  46. bool m_enableDebugDraw = false;
  47. //! If enabled, previews the navigation mesh in the Editor's viewport.
  48. bool m_enableEditorPreview = false;
  49. };
  50. } // namespace RecastNavigation