function () {
    var controller = this.controller;
    var data = this.data;
    var object3D = this.el.object3D;
    var pose;
    var vrDisplay = this.system.vrDisplay;
    var standingMatrix;

    if (!controller) { return; }

    // Compose pose from Gamepad.
    pose = controller.pose;

    if (pose.position) {
      object3D.position.fromArray(pose.position);
    } else {
      // Controller not 6DOF, apply arm model.
      if (data.armModel) { this.applyArmModel(object3D.position); }
    }

    if (pose.orientation) {
      object3D.quaternion.fromArray(pose.orientation);
    }

    // Apply transforms, if 6DOF and in VR.
    if (vrDisplay && pose.position) {
      standingMatrix = this.el.sceneEl.renderer.vr.getStandingMatrix();
      object3D.matrix.compose(object3D.position, object3D.quaternion, object3D.scale);
      object3D.matrix.multiplyMatrices(standingMatrix, object3D.matrix);
      object3D.matrix.decompose(object3D.position, object3D.quaternion, object3D.scale);
    }

    object3D.rotateX(this.data.orientationOffset.x * THREE.Math.DEG2RAD);
    object3D.rotateY(this.data.orientationOffset.y * THREE.Math.DEG2RAD);
    object3D.rotateZ(this.data.orientationOffset.z * THREE.Math.DEG2RAD);
  }
function () {
    var controller = this.controller;
    var data = this.data;
    var object3D = this.el.object3D;
    var pose;
    var vrDisplay = this.system.vrDisplay;
    var standingMatrix;

    if (!controller) { return; }

    // Compose pose from Gamepad.
    pose = controller.pose;

    if (pose.position) {
      object3D.position.fromArray(pose.position);
    } else {
      // Controller not 6DOF, apply arm model.
      if (data.armModel) { this.applyArmModel(object3D.position); }
    }

    if (pose.orientation) {
      object3D.quaternion.fromArray(pose.orientation);
    }

    // Apply transforms, if 6DOF and in VR.
    if (vrDisplay && pose.position) {
      standingMatrix = this.el.sceneEl.renderer.vr.getStandingMatrix();
      object3D.matrix.compose(object3D.position, object3D.quaternion, object3D.scale);
      object3D.matrix.multiplyMatrices(standingMatrix, object3D.matrix);
      object3D.matrix.decompose(object3D.position, object3D.quaternion, object3D.scale);
    }

    object3D.rotateX(this.data.orientationOffset.x * THREE.Math.DEG2RAD);
    object3D.rotateY(this.data.orientationOffset.y * THREE.Math.DEG2RAD);
    object3D.rotateZ(this.data.orientationOffset.z * THREE.Math.DEG2RAD);
  }
function ( ) { var controller = this . controller ; var data = this . data ; var object3D = this . el . object3D ; var pose ; var vrDisplay = this . system . vrDisplay ; var standingMatrix ; if ( ! controller ) { return ; } // Compose pose from Gamepad. pose = controller . pose ; if ( pose . position ) { object3D . position . fromArray ( pose . position ) ; } else { // Controller not 6DOF, apply arm model. if ( data . armModel ) { this . applyArmModel ( object3D . position ) ; } } if ( pose . orientation ) { object3D . quaternion . fromArray ( pose . orientation ) ; } // Apply transforms, if 6DOF and in VR. if ( vrDisplay && pose . position ) { standingMatrix = this . el . sceneEl . renderer . vr . getStandingMatrix ( ) ; object3D . matrix . compose ( object3D . position , object3D . quaternion , object3D . scale ) ; object3D . matrix . multiplyMatrices ( standingMatrix , object3D . matrix ) ; object3D . matrix . decompose ( object3D . position , object3D . quaternion , object3D . scale ) ; } object3D . rotateX ( this . data . orientationOffset . x * THREE . Math . DEG2RAD ) ; object3D . rotateY ( this . data . orientationOffset . y * THREE . Math . DEG2RAD ) ; object3D . rotateZ ( this . data . orientationOffset . z * THREE . Math . DEG2RAD ) ; }
Read pose from controller (from Gamepad API), apply transforms, apply to entity.
Read pose from controller ( from Gamepad API ) apply transforms apply to entity .
Apply object3D