Normalize() public méthode

Normalizes elements of this quaterion to the range [0,1].
public Normalize ( ) : void
Résultat void
Exemple #1
0
		public void Rotate( Quaternion qnorm )
		{
			// Note the order of the mult, i.e. q comes after

			// Normalise the quat to avoid cumulative problems with precision
			qnorm.Normalize();
			this.orientation = qnorm*this.orientation;

			InvalidateView();
		}
Exemple #2
0
		/// <summary>
		/// Rotate the node around an arbitrary axis using a Quaternion.
		/// </summary>
		public virtual void Rotate( Quaternion rotation, TransformSpace relativeTo )
		{
			rotation.Normalize(); // avoid drift

			switch ( relativeTo )
			{
				case TransformSpace.Parent:
					// Rotations are normally relative to local axes, transform up
					orientation = rotation * orientation;
					break;

				case TransformSpace.World:
					orientation = orientation * DerivedOrientation.Inverse() * rotation * DerivedOrientation;
					break;

				case TransformSpace.Local:
					// Note the order of the mult, i.e. q comes after
					orientation = orientation * rotation;
					break;
			}

			NeedUpdate();
		}