AnimGraphNetworkingBus.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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/EBus/EBus.h>
  10. #include <AzCore/Component/ComponentBus.h>
  11. namespace EMotionFX
  12. {
  13. using NodeIndexContainer = AZStd::vector<AZ::u32>;
  14. using MotionPlayTimeEntry = AZStd::pair<AZ::u32, float>;
  15. using MotionNodePlaytimeContainer = AZStd::vector<MotionPlayTimeEntry>;
  16. // Networking request bus
  17. class AnimGraphComponentNetworkRequests
  18. : public AZ::ComponentBus
  19. {
  20. public:
  21. static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
  22. virtual bool IsAssetReady() const = 0;
  23. virtual bool HasSnapshot() const = 0;
  24. virtual void CreateSnapshot(bool isAuthoritative) = 0;
  25. virtual void SetActiveStates(const NodeIndexContainer& activeStates) = 0;
  26. virtual const NodeIndexContainer& GetActiveStates() const = 0;
  27. virtual void SetMotionPlaytimes(const MotionNodePlaytimeContainer& motionNodePlaytimes) = 0;
  28. virtual const MotionNodePlaytimeContainer& GetMotionPlaytimes() const = 0;
  29. virtual void UpdateActorExternal(float deltatime) = 0;
  30. virtual void SetNetworkRandomSeed(AZ::u64 seed) = 0;
  31. virtual AZ::u64 GetNetworkRandomSeed() const = 0;
  32. virtual void SetActorThreadIndex(AZ::u32 threadIndex) = 0;
  33. virtual AZ::u32 GetActorThreadIndex() const = 0;
  34. };
  35. using AnimGraphComponentNetworkRequestBus = AZ::EBus<AnimGraphComponentNetworkRequests>;
  36. }