/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A.  All Rights Reserved.                         *
*                                                                          *
***************************************************************************/

#pragma once

#include <glmMotionDefinitions.h>
#include <glmAnimationPlayBN.h>
#include <glmCachePerThread.h>

namespace glm
{
	/**
	 * \brief Cache for generalized animation files
	 *
	 * \author dev@golaem.com
	 *
	 */
	class GLM_SDK_API AnimationPlayBNCache
	{
	public:
		/**
		* \brief GenericPostureArray, with array and size as member
		*/
		class Data
		{
		public:
			GLM_CLASS_STAT_ID( glm::MemoryStatIds::Simulation);

			Data() :
				_wPosArray(getClassMemoryStatId()),
				_footStrikeTimes(getClassMemoryStatId()),
				_footOffTimes(getClassMemoryStatId())
			{
			}

			glm::Array<Vector3> _wPosArray;
			glm::Array<double> _footStrikeTimes;
			glm::Array<double> _footOffTimes;
		};

		GLM_CLASS_STAT_ID( glm::MemoryStatIds::Simulation);

		AnimationPlayBNCache();
		~AnimationPlayBNCache();

		void clear();

		void getAnimationPlayBNCache(LockedThreadData<AnimationPlayBNCache::Data>& lockedPlayBNCache, size_t atLeastSize);

	private:
		CachePerThread<AnimationPlayBNCache::Data> _animPlayBNCachePerThread;
	};
}

