Axiom.Math.Quaternion.Normalize C# (CSharp) Method

Normalize() public method

Normalizes elements of this quaterion to the range [0,1].
public Normalize ( ) : void
return void
		public void Normalize()
		{
			Real factor = 1.0f / Utility.Sqrt( this.Norm );

			w = w * factor;
			x = x * factor;
			y = y * factor;
			z = z * factor;
		}

Usage Example

Example #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();
		}
All Usage Examples Of Axiom.Math.Quaternion::Normalize