src/components/hand-controls.js
function () {
    var gesture;
    var isGripActive = this.pressedButtons['grip'];
    var isSurfaceActive = this.pressedButtons['surface'] || this.touchedButtons['surface'];
    var isTrackpadActive = this.pressedButtons['trackpad'] || this.touchedButtons['trackpad'];
    var isTriggerActive = this.pressedButtons['trigger'] || this.touchedButtons['trigger'];
    var isABXYActive = this.touchedButtons['AorX'] || this.touchedButtons['BorY'];
    var isVive = isViveController(this.el.components['tracked-controls']);

    // Works well with Oculus Touch and Windows Motion Controls, but Vive needs tweaks.
    if (isVive) {
      if (isGripActive || isTriggerActive) {
        gesture = ANIMATIONS.fist;
      } else if (isTrackpadActive) {
        gesture = ANIMATIONS.point;
      }
    } else {
      if (isGripActive) {
        if (isSurfaceActive || isABXYActive || isTrackpadActive) {
          gesture = isTriggerActive ? ANIMATIONS.fist : ANIMATIONS.point;
        } else {
          gesture = isTriggerActive ? ANIMATIONS.thumbUp : ANIMATIONS.pointThumb;
        }
      } else if (isTriggerActive) {
        gesture = ANIMATIONS.hold;
      }
    }

    return gesture;
  }
function () {
    var gesture;
    var isGripActive = this.pressedButtons['grip'];
    var isSurfaceActive = this.pressedButtons['surface'] || this.touchedButtons['surface'];
    var isTrackpadActive = this.pressedButtons['trackpad'] || this.touchedButtons['trackpad'];
    var isTriggerActive = this.pressedButtons['trigger'] || this.touchedButtons['trigger'];
    var isABXYActive = this.touchedButtons['AorX'] || this.touchedButtons['BorY'];
    var isVive = isViveController(this.el.components['tracked-controls']);

    // Works well with Oculus Touch and Windows Motion Controls, but Vive needs tweaks.
    if (isVive) {
      if (isGripActive || isTriggerActive) {
        gesture = ANIMATIONS.fist;
      } else if (isTrackpadActive) {
        gesture = ANIMATIONS.point;
      }
    } else {
      if (isGripActive) {
        if (isSurfaceActive || isABXYActive || isTrackpadActive) {
          gesture = isTriggerActive ? ANIMATIONS.fist : ANIMATIONS.point;
        } else {
          gesture = isTriggerActive ? ANIMATIONS.thumbUp : ANIMATIONS.pointThumb;
        }
      } else if (isTriggerActive) {
        gesture = ANIMATIONS.hold;
      }
    }

    return gesture;
  }
function ( ) { var gesture ; var isGripActive = this . pressedButtons [ 'grip' ] ; var isSurfaceActive = this . pressedButtons [ 'surface' ] || this . touchedButtons [ 'surface' ] ; var isTrackpadActive = this . pressedButtons [ 'trackpad' ] || this . touchedButtons [ 'trackpad' ] ; var isTriggerActive = this . pressedButtons [ 'trigger' ] || this . touchedButtons [ 'trigger' ] ; var isABXYActive = this . touchedButtons [ 'AorX' ] || this . touchedButtons [ 'BorY' ] ; var isVive = isViveController ( this . el . components [ 'tracked-controls' ] ) ; // Works well with Oculus Touch and Windows Motion Controls, but Vive needs tweaks. if ( isVive ) { if ( isGripActive || isTriggerActive ) { gesture = ANIMATIONS . fist ; } else if ( isTrackpadActive ) { gesture = ANIMATIONS . point ; } } else { if ( isGripActive ) { if ( isSurfaceActive || isABXYActive || isTrackpadActive ) { gesture = isTriggerActive ? ANIMATIONS . fist : ANIMATIONS . point ; } else { gesture = isTriggerActive ? ANIMATIONS . thumbUp : ANIMATIONS . pointThumb ; } } else if ( isTriggerActive ) { gesture = ANIMATIONS . hold ; } } return gesture ; }
Determine which pose hand should be in considering active and touched buttons.
Determine which pose hand should be in considering active and touched buttons .