SimulationManager.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 <AzCore/Component/TickBus.h>
  11. #include <AzCore/Script/ScriptTimePoint.h>
  12. #include <AzFramework/Entity/EntityContextBus.h>
  13. #include <AzFramework/Physics/PhysicsScene.h>
  14. #include <AzFramework/Spawnable/SpawnableEntitiesInterface.h>
  15. #include <SimulationInterfaces/SimulationEntityManagerRequestBus.h>
  16. #include <SimulationInterfaces/SimulationMangerRequestBus.h>
  17. namespace SimulationInterfaces
  18. {
  19. class SimulationManager
  20. : public AZ::Component
  21. , protected SimulationManagerRequestBus::Handler
  22. {
  23. public:
  24. AZ_COMPONENT_DECL(SimulationManager);
  25. static void Reflect(AZ::ReflectContext* context);
  26. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  27. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  28. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  29. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  30. SimulationManager();
  31. ~SimulationManager();
  32. // AZ::Component
  33. void Init() override;
  34. void Activate() override;
  35. void Deactivate() override;
  36. protected:
  37. void SetSimulationPaused(bool paused) override;
  38. void StepSimulation(AZ::u32 steps) override;
  39. uint32_t m_numberOfPhysicsSteps = 0;
  40. AzPhysics::SceneEvents::OnSceneSimulationFinishHandler m_simulationFinishEvent;
  41. };
  42. } // namespace SimulationInterfaces