AssetBlendTrack.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 "IMovieSystem.h"
  10. #include "AnimTrack.h"
  11. #include <Maestro/Types/AssetBlends.h>
  12. /** CAssetBlendTrack contains entity keys, when time reach event key, it fires script event or start animation etc...
  13. */
  14. class CAssetBlendTrack
  15. : public TAnimTrack<AZ::IAssetBlendKey>
  16. {
  17. public:
  18. AZ_CLASS_ALLOCATOR(CAssetBlendTrack, AZ::SystemAllocator);
  19. AZ_RTTI(CAssetBlendTrack, "{8F606315-A8D9-4267-A1DA-8E84097F40CD}", IAnimTrack);
  20. CAssetBlendTrack()
  21. {
  22. }
  23. //////////////////////////////////////////////////////////////////////////
  24. // Overrides of IAnimTrack.
  25. //////////////////////////////////////////////////////////////////////////
  26. bool Serialize(XmlNodeRef& xmlNode, bool bLoading, bool bLoadEmptyTracks) override;
  27. void GetKeyInfo(int key, const char*& description, float& duration) override;
  28. void SerializeKey(AZ::IAssetBlendKey& key, XmlNodeRef& keyNode, bool bLoading) override;
  29. //! Gets the duration of an animation key. If it's a looped animation,
  30. //! a special consideration is required to compute the actual duration.
  31. float GetKeyDuration(int key) const;
  32. AnimValueType GetValueType() override;
  33. void GetValue(float time, Maestro::AssetBlends<AZ::Data::AssetData>& value) override;
  34. void SetDefaultValue(const Maestro::AssetBlends<AZ::Data::AssetData>& defaultValue);
  35. float GetEndTime() const;
  36. static void Reflect(AZ::ReflectContext* context);
  37. private:
  38. // Internal transient state, not serialized.
  39. Maestro::AssetBlends<AZ::Data::AssetData> m_assetBlend;
  40. Maestro::AssetBlends<AZ::Data::AssetData> m_defaultValue;
  41. };