/// <summary>
		/// Modify the transform by adding the specified delta, modified by the specified scale multiplier.
		/// </summary>
		/// <param name="scale">Scales the delta before applying it to the transform. To apply the delta exactly, use a scale of 1.</param>
		/// <param name="delta">The delta to apply to the transform.</param>
		public void ApplyDelta(float scale, ref TransformDelta delta)
		{
			Vector3 movement;

		    Vector3.Multiply(ref delta.Linear, scale, out movement);
		    Vector3.Add(ref Position, ref movement, out Position);

			Vector3 axis = delta.Angular;
			float length = axis.Length() * scale;
			if (length >= Constants.Epsilon)
			{
				axis.Normalize();
				Quaternion rotation;
				Quaternion.CreateFromAxisAngle(ref axis, length, out rotation);
				Quaternion.Multiply(ref rotation, ref Orientation, out Orientation);
				Orientation.Normalize();
			}

			Combine(Scale, ref Position, ref Orientation, out Combined);
		}
Exemple #2
0
        /// <summary>
        /// Modify the transform by adding the specified delta, modified by the specified scale multiplier.
        /// </summary>
        /// <param name="scale">Scales the delta before applying it to the transform. To apply the delta exactly, use a scale of 1.</param>
        /// <param name="delta">The delta to apply to the transform.</param>
        public void ApplyDelta(float scale, ref TransformDelta delta)
        {
            Vector3 movement;

            Vector3.Multiply(ref delta.Linear, scale, out movement);
            Vector3.Add(ref Position, ref movement, out Position);

            Vector3 axis   = delta.Angular;
            float   length = axis.Length() * scale;

            if (length >= Constants.Epsilon)
            {
                axis.Normalize();
                Quaternion rotation;
                Quaternion.CreateFromAxisAngle(ref axis, length, out rotation);
                Quaternion.Multiply(ref rotation, ref Orientation, out Orientation);
                Orientation.Normalize();
            }

            Combine(Scale, ref Position, ref Orientation, out Combined);
        }