Beispiel #1
0
        /// <summary>
        /// Creates a quaternion from a matrix.
        /// </summary>
        /// <param name="matrix">A matrix representing an orientation.</param>
        /// <returns>JQuaternion representing an orientation.</returns>
        #region public static JQuaternion CreateFromMatrix(JMatrix matrix)
        public static TSQuaternion CreateFromMatrix(TSMatrix matrix)
        {
            TSQuaternion result;

            TSQuaternion.CreateFromMatrix(ref matrix, out result);
            return(result);
        }
Beispiel #2
0
 /**
  *  @brief Rotates game object to point forward vector to a target position.
  *
  *  @param target Target position.
  **/
 public void LookAt(TSVector target)
 {
     this.rotation = TSQuaternion.CreateFromMatrix(TSMatrix.CreateFromLookAt(position, target));
 }