function [ MotionData ] = Prep_Traj2Deltas( MotionData )
%PREP_CALCDELTAS Summary of this function goes here
%   Detailed explanation goes here


% calculate the forward detlas for root x,y,z position
% for each frame, the difference to the next frame is calculated and
% replaced



for m=1:length(MotionData.data)    
    deltaPos = 0;
    for f=1:size(MotionData.data{m},1)-1      
        deltaPos = MotionData.data{m}(f+1,[1,3]) - MotionData.data{m}(f,[1,3]);
        MotionData.data{m}(f,[1,3]) = deltaPos;
    end    
    MotionData.data{m}(size(MotionData.data{m},1),[1,3]) = deltaPos;
end

end

