DirectorNodeAnimator.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 "TrackViewAnimNode.h"
  10. #include <AzCore/std/functional.h>
  11. // This is used to bind/unbind sub sequences in director nodes
  12. // when the sequence time changes. A sequence only gets bound if it was already
  13. // referred in time before.
  14. class CDirectorNodeAnimator
  15. : public IAnimNodeAnimator
  16. {
  17. public:
  18. CDirectorNodeAnimator(CTrackViewAnimNode* pDirectorNode);
  19. void Animate(CTrackViewAnimNode* pNode, const SAnimContext& ac) override;
  20. void Render(CTrackViewAnimNode* pNode, const SAnimContext& ac) override;
  21. void UnBind(CTrackViewAnimNode* pNode) override;
  22. // Utility function to find a CTrackViewSequence* from an ISequenceKey
  23. static CTrackViewSequence* GetSequenceFromSequenceKey(const ISequenceKey& sequenceKey);
  24. private:
  25. void ForEachActiveSequence(const SAnimContext& ac, CTrackViewTrack* pSequenceTrack,
  26. const bool bHandleOtherKeys, std::function<void(CTrackViewSequence*, const SAnimContext&)> animateFunction,
  27. std::function<void(CTrackViewSequence*, const SAnimContext&)> resetFunction);
  28. };