src/Transform.js
function Transform( that ) {
        that = that || {};
        if ( that.data instanceof Array ) {
            // Mat33 or Mat44, extract transform components
            that = that.decompose();
            this.rotation = that.rotation;
            this.translation = that.translation || new Vec3();
            this.scale = that.scale;
        } else {
            // set individual components, by value
            this.rotation = that.rotation ? new Quaternion( that.rotation ) : new Quaternion();
            this.translation = that.translation ? new Vec3( that.translation ) : new Vec3();
            if ( typeof that.scale === 'number' ) {
                this.scale = new Vec3( that.scale, that.scale, that.scale );
            } else {
                this.scale = that.scale ? new Vec3( that.scale ) : new Vec3( 1, 1, 1 );
            }
        }
    }
function Transform( that ) {
        that = that || {};
        if ( that.data instanceof Array ) {
            // Mat33 or Mat44, extract transform components
            that = that.decompose();
            this.rotation = that.rotation;
            this.translation = that.translation || new Vec3();
            this.scale = that.scale;
        } else {
            // set individual components, by value
            this.rotation = that.rotation ? new Quaternion( that.rotation ) : new Quaternion();
            this.translation = that.translation ? new Vec3( that.translation ) : new Vec3();
            if ( typeof that.scale === 'number' ) {
                this.scale = new Vec3( that.scale, that.scale, that.scale );
            } else {
                this.scale = that.scale ? new Vec3( that.scale ) : new Vec3( 1, 1, 1 );
            }
        }
    }
function Transform ( that ) { that = that || { } ; if ( that . data instanceof Array ) { // Mat33 or Mat44, extract transform components that = that . decompose ( ) ; this . rotation = that . rotation ; this . translation = that . translation || new Vec3 ( ) ; this . scale = that . scale ; } else { // set individual components, by value this . rotation = that . rotation ? new Quaternion ( that . rotation ) : new Quaternion ( ) ; this . translation = that . translation ? new Vec3 ( that . translation ) : new Vec3 ( ) ; if ( typeof that . scale === 'number' ) { this . scale = new Vec3 ( that . scale , that . scale , that . scale ) ; } else { this . scale = that . scale ? new Vec3 ( that . scale ) : new Vec3 ( 1 , 1 , 1 ) ; } } }
Instantiates a Transform object.
@class Transform
@classdesc A transform representing an orientation, position, and scale.
Instantiates a Transform object .