Vec3 BezierInterpolation(const Mat44& inv_mat,const Vec3 & P0,const Vec3 & P1, const Vec3 & P2,const Vec3 & P3, float t) { // inv_mat = B Matrix, Mixture matrix. Vec4 U = Vec4(1.0,t, t*t, t*t*t); // A Matrix = UxB Vec4 A = U*inv_mat; // p(u) = UxBxP return P0*A.GetX() + P1*A.GetY() + P2*A.GetZ() + P3*A.GetW(); };
float WeightedClusterFit::GetBestError() const { #if SQUISH_USE_SIMD Vec4 x = m_xxsum * m_metricSqr; Vec4 error = m_besterror + x.SplatX() + x.SplatY() + x.SplatZ(); return error.GetX(); #else return m_besterror + Dot(m_xxsum, m_metricSqr); #endif }
Vec3::Vec3(const Vec4 & vec){ m_X = vec.GetX(); m_Y = vec.GetY(); m_Z = vec.GetZ(); }