src/Quaternion.js
function Quaternion() {
        switch ( arguments.length ) {
            case 1:
                // array or Quaternion argument
                var argument = arguments[0];
                if ( argument.w !== undefined ) {
                    this.w = argument.w;
                } else if ( argument[0] !== undefined ) {
                    this.w = argument[0];
                } else {
                    this.w = 1.0;
                }
                this.x = argument.x || argument[1] || 0.0;
                this.y = argument.y || argument[2] || 0.0;
                this.z = argument.z || argument[3] || 0.0;
                break;
            case 4:
                // individual component arguments
                this.w = arguments[0];
                this.x = arguments[1];
                this.y = arguments[2];
                this.z = arguments[3];
                break;
            default:
                this.w = 1;
                this.x = 0;
                this.y = 0;
                this.z = 0;
                break;
        }
    }
function Quaternion() {
        switch ( arguments.length ) {
            case 1:
                // array or Quaternion argument
                var argument = arguments[0];
                if ( argument.w !== undefined ) {
                    this.w = argument.w;
                } else if ( argument[0] !== undefined ) {
                    this.w = argument[0];
                } else {
                    this.w = 1.0;
                }
                this.x = argument.x || argument[1] || 0.0;
                this.y = argument.y || argument[2] || 0.0;
                this.z = argument.z || argument[3] || 0.0;
                break;
            case 4:
                // individual component arguments
                this.w = arguments[0];
                this.x = arguments[1];
                this.y = arguments[2];
                this.z = arguments[3];
                break;
            default:
                this.w = 1;
                this.x = 0;
                this.y = 0;
                this.z = 0;
                break;
        }
    }
function Quaternion ( ) { switch ( arguments . length ) { case 1 : // array or Quaternion argument var argument = arguments [ 0 ] ; if ( argument . w !== undefined ) { this . w = argument . w ; } else if ( argument [ 0 ] !== undefined ) { this . w = argument [ 0 ] ; } else { this . w = 1.0 ; } this . x = argument . x || argument [ 1 ] || 0.0 ; this . y = argument . y || argument [ 2 ] || 0.0 ; this . z = argument . z || argument [ 3 ] || 0.0 ; break ; case 4 : // individual component arguments this . w = arguments [ 0 ] ; this . x = arguments [ 1 ] ; this . y = arguments [ 2 ] ; this . z = arguments [ 3 ] ; break ; default : this . w = 1 ; this . x = 0 ; this . y = 0 ; this . z = 0 ; break ; } }
Instantiates a Quaternion object.
@class Quaternion
@classdesc A quaternion representing an orientation.
Instantiates a Quaternion object .