Exemplo n.º 1
0
        public static Quat FromTo(Vec3 fromNorm, Vec3 toNorm)
        {
            Vec3 mf = VecX.Normalize(fromNorm + toNorm);
            Quat nq = new Quat(VecX.Cross(mf, toNorm), VecX.Dot(mf, toNorm));

            return(nq);
        }
Exemplo n.º 2
0
 private void ProcessBasis()
 {
     for (int i = 0; i < m_basis.Length; i++)
     {
         T v = m_basis[i];
         for (int j = 0; j < i; j++)
         {
             v = VecX.Orthogonalize(v, m_basis[j]);
         }
         m_basis[i] = VecX.Normalize(v);
     }
 }