AnimPostFXNode.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. #ifndef CRYINCLUDE_CRYMOVIE_ANIMPOSTFXNODE_H
  9. #define CRYINCLUDE_CRYMOVIE_ANIMPOSTFXNODE_H
  10. #pragma once
  11. #include "AnimNode.h"
  12. class CFXNodeDescription;
  13. //////////////////////////////////////////////////////////////////////////
  14. class CAnimPostFXNode
  15. : public CAnimNode
  16. {
  17. public:
  18. AZ_CLASS_ALLOCATOR(CAnimPostFXNode, AZ::SystemAllocator);
  19. AZ_RTTI(CAnimPostFXNode, "{41FCA8BB-46A8-4F37-87C2-C1D10994854B}", CAnimNode);
  20. //-----------------------------------------------------------------------------
  21. //!
  22. static void Initialize();
  23. static CFXNodeDescription* GetFXNodeDescription(AnimNodeType nodeType);
  24. static CAnimNode* CreateNode(const int id, AnimNodeType nodeType);
  25. //-----------------------------------------------------------------------------
  26. //!
  27. CAnimPostFXNode();
  28. CAnimPostFXNode(const int id, AnimNodeType nodeType, CFXNodeDescription* pDesc);
  29. //-----------------------------------------------------------------------------
  30. //!
  31. void SerializeAnims(XmlNodeRef& xmlNode, bool bLoading, bool bLoadEmptyTracks) override;
  32. //-----------------------------------------------------------------------------
  33. //!
  34. unsigned int GetParamCount() const override;
  35. CAnimParamType GetParamType(unsigned int nIndex) const override;
  36. //-----------------------------------------------------------------------------
  37. //!
  38. //-----------------------------------------------------------------------------
  39. //!
  40. void CreateDefaultTracks() override;
  41. void OnReset() override;
  42. //-----------------------------------------------------------------------------
  43. //!
  44. void Animate(SAnimContext& ac) override;
  45. void InitPostLoad(IAnimSequence* sequence) override;
  46. static void Reflect(AZ::ReflectContext* context);
  47. protected:
  48. bool GetParamInfoFromType(const CAnimParamType& paramId, SParamInfo& info) const override;
  49. using FxNodeDescriptionMap = AZStd::map<AnimNodeType, AZStd::unique_ptr<CFXNodeDescription>>;
  50. static FxNodeDescriptionMap s_fxNodeDescriptions;
  51. static inline bool s_initialized{};
  52. CFXNodeDescription* m_pDescription;
  53. };
  54. #endif // CRYINCLUDE_CRYMOVIE_ANIMPOSTFXNODE_H