IC void key_add(CKey &res, const CKey &k0, const CKey &k1)//add right { res.Q.set(Fquaternion().mul(k0.Q,k1.Q)); //res.Q.normalize(); res.T.add(k0.T,k1.T); }
poses_interpolation::poses_interpolation (const Fmatrix &m0, const Fmatrix &m1 ): p0( m0.c ), p1( m1.c ), q0( Fquaternion().set( m0 ) ), q1( Fquaternion().set( m1 ) ) { }
void poses_interpolation::pose ( Fmatrix &p, float factor ) const { p.rotation( Fquaternion().slerp( q0, q1, factor ) ); p.c.lerp( p0, p1, factor ); }