QuaternionExtensions

Author: Kieren Wallace (kdw.weebly.com)

Overview
This script provide a few useful extensions to the inbuilt 'Quaternion' struct. The Exponent, Magnitude, and Scalar Multiplication methods are useful for writing specialised Quaternion math functions, and the Power method is used to rotate a given quaternion an exact multiple of iteslf.

Usage
To use these methods, simply append them to a given Quaternion.

quaternion.Exp - returns euler's number raised to quaternion

quaternion.Magnitude - returns the float magnitude of quaternion

quaternion.ScalarMultipy(float scalar) - returns quaternion multiplied by scalar

quaternion.Pow(float pow) - returns quaternion raised to the power pow. This is useful for smoothly multiplying a Quaternion by a given floating-point value.

Example - RotateObject.cs
This script will rotate the gameObject by rotateOffset's local rotation once per second.