#pragma once

#include <chrono>
#include <functional>
#include <optional>
#include <memory>
#include "Mat4.h"

namespace Aftr
{

class AftrMotionData
{
public:
   AftrMotionData();
   virtual ~AftrMotionData();
   virtual Vector getPositionAtParametricOffset( double p ) = 0;
   virtual void getOrientationAtParametricOffset( double p, float outM[16] ) = 0;
   virtual void getPoseAtParametricOffset( double p, Vector& outPos, float outM[16] ) = 0;
};

//Input p is the parametric time [0,1]
using motion_functor_p = std::function< std::optional<Mat4>( 
   std::chrono::system_clock::time_point timeNow ) >;

motion_functor_p make_motion_functor(
   std::shared_ptr<AftrMotionData> motionData, std::chrono::duration< double > motionTime );

}

