//////////////////////////////////////////////////////////////////////////////// // for each HSKL bone in GLUT //////////////////////////////////////////////////////////////////////////////// hskl::float4x4 PoseToMatrix(hskl::float4 q, hskl::float3 tr) { hskl::float4x4 m; (hskl::float3&)m.x = qxdir(q); (hskl::float3&)m.y = qydir(q); (hskl::float3&)m.z = qzdir(q); (hskl::float3&)m.w = tr; m.w.w = 1; return m; }
float4x4 ScaledTransformationMatrix(const float3 & scale, const float4 & rot, const float3 & vec) { return {{qxdir(rot)*scale.x,0},{qydir(rot)*scale.y,0},{qzdir(rot)*scale.z,0},{vec,1}}; }
float4x4 RigidTransformationMatrix(const float4 & rot, const float3 & vec) { return {{qxdir(rot),0},{qydir(rot),0},{qzdir(rot),0},{vec,1}}; }