Optimize animation position compuration