DirectorNodeAnimator.h 1.4 KB

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