template<typename T, unsigned int size> cml::vector<T, cml::fixed<size>>& CatmullRom(const cml::vector<T, cml::fixed<size>>& vP0, const cml::vector<T, cml::fixed<size>>& vP1, const cml::vector<T, cml::fixed<size>>& vP2, const cml::vector<T, cml::fixed<size>>& vP3, cml::vector<T, cml::fixed<size>>& result, T t){ T t2 = t * t; T t3 = t2 * t; result = 0.5 * ((2 * vP1) + (-vP0 + vP2) * t + (2 * vP0 - 5 *vP1 + 4 * vP2 - vP3) * t2 + (-vP0 + 3 * vP1 - 3 * vP2 + vP3) * t3); return result;}
NX::MATH::CatmullRom<float, 3>(cml::vector3f(1,0,1),
cml::vector3f(2,0,2),
cml::vector3f(3,0,3),
cml::vector3f(4,0,4),
temp,
0);
I get 2,0,2 for a result, if that is correct... But this seems more like a linear interpolation, but I am unsure...
Thanks!