dist/claygl.es.js
function (frameTime) {
        var target = this.target;

        var position = this.target.position;
        var xAxis = target.localTransform.x.normalize();
        var zAxis = target.localTransform.z.normalize();

        if (this.verticalMoveLock) {
            zAxis.y = 0;
            zAxis.normalize();
        }

        var speed = this.speed * frameTime / 20;

        if (this._moveForward) {
            // Opposite direction of z
            position.scaleAndAdd(zAxis, -speed);
        }
        if (this._moveBackward) {
            position.scaleAndAdd(zAxis, speed);
        }
        if (this._moveLeft) {
            position.scaleAndAdd(xAxis, -speed / 2);
        }
        if (this._moveRight) {
            position.scaleAndAdd(xAxis, speed / 2);
        }

        target.rotateAround(target.position, this.up, -this._offsetPitch * frameTime * Math.PI / 360);
        var xAxis = target.localTransform.x;
        target.rotateAround(target.position, xAxis, -this._offsetRoll * frameTime * Math.PI / 360);

        this._offsetRoll = this._offsetPitch = 0;
    }
function (frameTime) {
        var target = this.target;

        var position = this.target.position;
        var xAxis = target.localTransform.x.normalize();
        var zAxis = target.localTransform.z.normalize();

        if (this.verticalMoveLock) {
            zAxis.y = 0;
            zAxis.normalize();
        }

        var speed = this.speed * frameTime / 20;

        if (this._moveForward) {
            // Opposite direction of z
            position.scaleAndAdd(zAxis, -speed);
        }
        if (this._moveBackward) {
            position.scaleAndAdd(zAxis, speed);
        }
        if (this._moveLeft) {
            position.scaleAndAdd(xAxis, -speed / 2);
        }
        if (this._moveRight) {
            position.scaleAndAdd(xAxis, speed / 2);
        }

        target.rotateAround(target.position, this.up, -this._offsetPitch * frameTime * Math.PI / 360);
        var xAxis = target.localTransform.x;
        target.rotateAround(target.position, xAxis, -this._offsetRoll * frameTime * Math.PI / 360);

        this._offsetRoll = this._offsetPitch = 0;
    }
function ( frameTime ) { var target = this . target ; var position = this . target . position ; var xAxis = target . localTransform . x . normalize ( ) ; var zAxis = target . localTransform . z . normalize ( ) ; if ( this . verticalMoveLock ) { zAxis . y = 0 ; zAxis . normalize ( ) ; } var speed = this . speed * frameTime / 20 ; if ( this . _moveForward ) { // Opposite direction of z position . scaleAndAdd ( zAxis , - speed ) ; } if ( this . _moveBackward ) { position . scaleAndAdd ( zAxis , speed ) ; } if ( this . _moveLeft ) { position . scaleAndAdd ( xAxis , - speed / 2 ) ; } if ( this . _moveRight ) { position . scaleAndAdd ( xAxis , speed / 2 ) ; } target . rotateAround ( target . position , this . up , - this . _offsetPitch * frameTime * Math . PI / 360 ) ; var xAxis = target . localTransform . x ; target . rotateAround ( target . position , xAxis , - this . _offsetRoll * frameTime * Math . PI / 360 ) ; this . _offsetRoll = this . _offsetPitch = 0 ; }
Control update. Should be invoked every frame
@param {number} frameTime Frame time
Control update . Should be invoked every frame