public void Normalize() { Real factor = 1.0f / Utility.Sqrt( this.Norm ); w = w * factor; x = x * factor; y = y * factor; z = z * factor; }
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(); }