update(dt, constants) {
        this.a = GTE.vec3(0.0, 0.0, 0.0);
        for (let i = 0; i < this.accelerations.length; i++) {
            this.a.accum(this.accelerations[i], 1.0);
        }

        let accelerations = [
            GTE.vec3(0.0, constants.g, 0.0),
            this.v.scale(-constants.drag)
        ];
        for (let i = 0; i < accelerations.length; i++) {
            this.a.accum(accelerations[i], 1.0);
        }

        this.v = GTE.vec3(
            0.5 * (this.v.x + this.a.x * dt + this.v.x),
            0.5 * (this.v.y + this.a.y * dt + this.v.y),
            0.5 * (this.v.z + this.a.z * dt + this.v.z)
        );

        if (this.v.x < 0) {
            this.facingDirection = -1;
        } else if (this.v.x > 0) {
            this.facingDirection = 1;
        }

        this.x.accum(this.v, dt);
    }
/**
     * update(dt)
     * @param {number} dt time in seconds elapsed since the last call
     * @param {PhysicsConstants} constants standard constants for physics calculations
     */
update(dt)
@param {number} dt time in seconds elapsed since the last call
@param {PhysicsConstants} constants standard constants for physics calculations
update ( dt ) @param { number } dt time in seconds elapsed since the last call @param { PhysicsConstants } constants standard constants for physics calculations
update(dt, constants) {
        this.a = GTE.vec3(0.0, 0.0, 0.0);
        for (let i = 0; i < this.accelerations.length; i++) {
            this.a.accum(this.accelerations[i], 1.0);
        }
        let accelerations = [
            GTE.vec3(0.0, constants.g, 0.0),
            this.v.scale(-constants.drag)
        ];
        for (let i = 0; i < accelerations.length; i++) {
            this.a.accum(accelerations[i], 1.0);
        }
        this.v = GTE.vec3(
            0.5 * (this.v.x + this.a.x * dt + this.v.x),
            0.5 * (this.v.y + this.a.y * dt + this.v.y),
            0.5 * (this.v.z + this.a.z * dt + this.v.z)
        );
        if (this.v.x < 0) {
            this.facingDirection = -1;
        } else if (this.v.x > 0) {
            this.facingDirection = 1;
        }
        this.x.accum(this.v, dt);
    }
update ( dt , constants ) { this . a = GTE . vec3 ( 0.0 , 0.0 , 0.0 ) ; for ( let i = 0 ; i < this . accelerations . length ; i ++ ) { this . a . accum ( this . accelerations [ i ] , 1.0 ) ; } let accelerations = [ GTE . vec3 ( 0.0 , constants . g , 0.0 ) , this . v . scale ( - constants . drag ) ] ; for ( let i = 0 ; i < accelerations . length ; i ++ ) { this . a . accum ( accelerations [ i ] , 1.0 ) ; } this . v = GTE . vec3 ( 0.5 * ( this . v . x + this . a . x * dt + this . v . x ) , 0.5 * ( this . v . y + this . a . y * dt + this . v . y ) , 0.5 * ( this . v . z + this . a . z * dt + this . v . z ) ) ; if ( this . v . x < 0 ) { this . facingDirection = - 1 ; } else if ( this . v . x > 0 ) { this . facingDirection = 1 ; } this . x . accum ( this . v , dt ) ; }
update(dt)
 @param {number} dt time in seconds elapsed since the last call
 @param {PhysicsConstants} constants standard constants for physics calculations
update ( dt ) @param { number } dt time in seconds elapsed since the last call @param { PhysicsConstants } constants standard constants for physics calculations