BsAnimationManager.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #include "BsModule.h"
  6. namespace BansheeEngine
  7. {
  8. /** @addtogroup Animation-Internal
  9. * @{
  10. */
  11. /**
  12. * Keeps track of all active animations, queues animation thread tasks and synchronizes data between simulation, core
  13. * and animation threads.
  14. */
  15. class AnimationManager : public Module<AnimationManager>
  16. {
  17. public:
  18. AnimationManager();
  19. private:
  20. friend class Animation;
  21. /**
  22. * Registers a new animation and returns a unique ID for it. Must be called whenever an Animation is constructed.
  23. */
  24. UINT64 registerAnimation(Animation* anim);
  25. /** Unregisters an animation with the specified ID. Must be called before an Animation is destroyed. */
  26. void unregisterAnimation(UINT64 id);
  27. UINT64 mNextId;
  28. UnorderedMap<UINT64, Animation*> mAnimations;
  29. };
  30. /** @} */
  31. }