EditorDetourNavigationComponent.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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/Component.h>
  10. #include <ToolsComponents/EditorComponentBase.h>
  11. namespace RecastNavigation
  12. {
  13. //! Editor version of a path finding component, @DetourNavigationComponent.
  14. class EditorDetourNavigationComponent final
  15. : public AzToolsFramework::Components::EditorComponentBase
  16. {
  17. public:
  18. AZ_EDITOR_COMPONENT(EditorDetourNavigationComponent, "{A8D728AB-FC42-42AE-A904-3CF5F1C83D16}", AzToolsFramework::Components::EditorComponentBase);
  19. static void Reflect(AZ::ReflectContext* context);
  20. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  21. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  22. //! EditorComponentBase overrides ...
  23. //! @{
  24. void Activate() override;
  25. void Deactivate() override;
  26. void BuildGameEntity(AZ::Entity* gameEntity) override;
  27. //! @}
  28. private:
  29. //! Entity with Recast Navigation Mesh component.
  30. AZ::EntityId m_navQueryEntityId;
  31. //! If FindPath APIs are given points that are outside the navigation mesh, then
  32. //! look for the nearest point on the navigation mesh within this distance from the specified positions.
  33. float m_nearestDistance = 3.f;
  34. };
  35. } // namespace RecastNavigation