/// <summary>
        ///
        /// </summary>
        /// <param name="r0"></param>
        /// <param name="r1"></param>
        /// <param name="p0"></param>
        /// <param name="p1"></param>
        public void Set(Vec3d p0, Quaterniond r0, Vec3d p1, Quaterniond r1)
        {
            r0.Invert();
            _r10 = r0.Apply(r1);
            _d10 = r0.Apply(p1 - p0);

            r1.Invert();
            _d01 = r1.Apply(p0 - p1);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Transforms a vector by a quaternion rotation.
        /// </summary>
        /// <param name="vec">The vector to transform.</param>
        /// <param name="quat">The quaternion to rotate the vector by.</param>
        /// <param name="result">The result of the operation.</param>
        public static void Transform(ref Vector2d vec, ref Quaterniond quat, out Vector2d result)
        {
            Quaterniond v = new Quaterniond(vec.X, vec.Y, 0, 0), i, t;

            Quaterniond.Invert(ref quat, out i);
            Quaterniond.Multiply(ref quat, ref v, out t);
            Quaterniond.Multiply(ref t, ref i, out v);

            result = new Vector2d(v.X, v.Y);
        }
Ejemplo n.º 3
0
        public override void Undo()
        {
            base.Undo();
            for (int i = 0; i < m_affectedActors.Count; i++)
            {
                if (m_transformSpace == FTransformSpace.Local)
                {
                    m_affectedActors[i].Transform.Rotation *= Quaterniond.Invert(m_delta);
                }
                else
                {
                    m_affectedActors[i].Transform.Rotation = Quaterniond.Invert(m_delta) * m_affectedActors[i].Transform.Rotation;
                }
            }

            m_mode.UpdateGizmoTransform();
        }