From fcdfae5a678ed3180b1190ef823a6ebc641910ea Mon Sep 17 00:00:00 2001 From: r3tk0n Date: Wed, 27 Feb 2019 08:39:35 -0800 Subject: [PATCH] Fix notion of hand dominance. --- interface/resources/controllers/standard.json | 128 +++++++++--------- .../controllerModules/farGrabEntity.js | 10 +- .../controllers/controllerModules/teleport.js | 6 +- 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/interface/resources/controllers/standard.json b/interface/resources/controllers/standard.json index 25f75c5670..7e23379394 100644 --- a/interface/resources/controllers/standard.json +++ b/interface/resources/controllers/standard.json @@ -2,68 +2,11 @@ "name": "Standard to Action", "channels": [ { "from": "Standard.LY", - "when": ["Application.LeftHandDominant", "!Standard.RY"], + "when": ["Application.RightHandDominant", "!Standard.RY"], "to": "Actions.TranslateZ" }, { "from": "Standard.LX", - "when": [ - "Application.InHMD", "!Application.AdvancedMovement", "Application.LeftHandDominant", - "Application.SnapTurn", "!Standard.RX" - ], - "to": "Actions.StepYaw", - "filters": - [ - { "type": "deadZone", "min": 0.15 }, - "constrainToInteger", - { "type": "pulse", "interval": 0.25 }, - { "type": "scale", "scale": 22.5 } - ] - }, - { "from": "Standard.LX", "to": "Actions.TranslateX", - "when": [ "Application.AdvancedMovement", "Application.LeftHandDominant" ] - }, - { "from": "Standard.LX", "to": "Actions.Yaw", - "when": [ "!Application.AdvancedMovement", "!Application.SnapTurn", "Application.LeftHandDominant" ] - }, - - { "from": "Standard.RX", - "when": [ "Application.SnapTurn", "Application.LeftHandDominant" ], - "to": "Actions.StepYaw", - "filters": - [ - { "type": "deadZone", "min": 0.15 }, - "constrainToInteger", - { "type": "pulse", "interval": 0.25 }, - { "type": "scale", "scale": 22.5 } - ] - }, - { "from": "Standard.RX", "to": "Actions.Yaw", - "when": [ "!Application.SnapTurn", "Application.LeftHandDominant" ] - }, - - { "from": "Standard.RY", - "when": [ "Application.Grounded", "Application.LeftHandDominant" ], - "to": "Actions.Up", - "filters": - [ - { "type": "deadZone", "min": 0.6 }, - "invert" - ] - }, - - { "from": "Standard.RY", - "when": "Application.LeftHandDominant", - "to": "Actions.Up", - "filters": "invert" - }, - - { "from": "Standard.RY", - "when": ["Application.RightHandDominant", "!Standard.LY"], - "to": "Actions.TranslateZ" - }, - - { "from": "Standard.RX", "when": [ "Application.InHMD", "!Application.AdvancedMovement", "Application.RightHandDominant", "Application.SnapTurn", "!Standard.RX" @@ -77,14 +20,14 @@ { "type": "scale", "scale": 22.5 } ] }, - { "from": "Standard.RX", "to": "Actions.TranslateX", + { "from": "Standard.LX", "to": "Actions.TranslateX", "when": [ "Application.AdvancedMovement", "Application.RightHandDominant" ] }, - { "from": "Standard.RX", "to": "Actions.Yaw", + { "from": "Standard.LX", "to": "Actions.Yaw", "when": [ "!Application.AdvancedMovement", "!Application.SnapTurn", "Application.RightHandDominant" ] }, - { "from": "Standard.LX", + { "from": "Standard.RX", "when": [ "Application.SnapTurn", "Application.RightHandDominant" ], "to": "Actions.StepYaw", "filters": @@ -95,11 +38,11 @@ { "type": "scale", "scale": 22.5 } ] }, - { "from": "Standard.LX", "to": "Actions.Yaw", + { "from": "Standard.RX", "to": "Actions.Yaw", "when": [ "!Application.SnapTurn", "Application.RightHandDominant" ] }, - { "from": "Standard.LY", + { "from": "Standard.RY", "when": [ "Application.Grounded", "Application.RightHandDominant" ], "to": "Actions.Up", "filters": @@ -109,11 +52,68 @@ ] }, - { "from": "Standard.LY", + { "from": "Standard.RY", "when": "Application.RightHandDominant", "to": "Actions.Up", "filters": "invert" }, + + { "from": "Standard.RY", + "when": ["Application.LeftHandDominant", "!Standard.LY"], + "to": "Actions.TranslateZ" + }, + + { "from": "Standard.RX", + "when": [ + "Application.InHMD", "!Application.AdvancedMovement", "Application.LeftHandDominant", + "Application.SnapTurn", "!Standard.RX" + ], + "to": "Actions.StepYaw", + "filters": + [ + { "type": "deadZone", "min": 0.15 }, + "constrainToInteger", + { "type": "pulse", "interval": 0.25 }, + { "type": "scale", "scale": 22.5 } + ] + }, + { "from": "Standard.RX", "to": "Actions.TranslateX", + "when": [ "Application.AdvancedMovement", "Application.LeftHandDominant" ] + }, + { "from": "Standard.RX", "to": "Actions.Yaw", + "when": [ "!Application.AdvancedMovement", "!Application.SnapTurn", "Application.LeftHandDominant" ] + }, + + { "from": "Standard.LX", + "when": [ "Application.SnapTurn", "Application.LeftHandDominant" ], + "to": "Actions.StepYaw", + "filters": + [ + { "type": "deadZone", "min": 0.15 }, + "constrainToInteger", + { "type": "pulse", "interval": 0.25 }, + { "type": "scale", "scale": 22.5 } + ] + }, + { "from": "Standard.LX", "to": "Actions.Yaw", + "when": [ "!Application.SnapTurn", "Application.LeftHandDominant" ] + }, + + { "from": "Standard.LY", + "when": [ "Application.Grounded", "Application.LeftHandDominant" ], + "to": "Actions.Up", + "filters": + [ + { "type": "deadZone", "min": 0.6 }, + "invert" + ] + }, + + { "from": "Standard.LY", + "when": "Application.LeftHandDominant", + "to": "Actions.Up", + "filters": "invert" + }, { "from": "Standard.Back", "to": "Actions.CycleCamera" }, { "from": "Standard.Start", "to": "Actions.ContextMenu" }, diff --git a/scripts/system/controllers/controllerModules/farGrabEntity.js b/scripts/system/controllers/controllerModules/farGrabEntity.js index ea0c3e8ad6..600f9a2772 100644 --- a/scripts/system/controllers/controllerModules/farGrabEntity.js +++ b/scripts/system/controllers/controllerModules/farGrabEntity.js @@ -239,7 +239,7 @@ Script.include("/~/system/libraries/controllers.js"); // var newTargetPosLocal = Mat4.transformPoint(MyAvatar.getSensorToWorldMatrix(), newTargetPosition); var newTargetPosLocal = MyAvatar.worldToJointPoint(newTargetPosition); if (this.shouldManipulateTarget()) { - var pose = Controller.getPoseValue((this.getDominantHand() ? Controller.Standard.RightHand : Controller.Standard.LeftHand)); + var pose = Controller.getPoseValue((this.getDominantHand() ? Controller.Standard.LeftHand : Controller.Standard.RightHand)); if (pose.valid) { if (!this.manipulating) { if (!this.wasManipulating) { @@ -400,7 +400,7 @@ Script.include("/~/system/libraries/controllers.js"); }; this.shouldShowLaser = function () { - return (_this.getOffHandTrigger() > TRIGGER_ON_VALUE) ? true : false; + return (_this.getDominantTrigger() > TRIGGER_ON_VALUE) ? true : false; }; this.shouldGrab = function () { @@ -409,11 +409,11 @@ Script.include("/~/system/libraries/controllers.js"); this.shouldCancel = function () { // Kill condition : Off hand is <= 15% trigger pull. - return (_this.getOffHandTrigger() <= TRIGGER_OFF_VALUE) ? true : false; + return (_this.getDominantTrigger() <= TRIGGER_OFF_VALUE) ? true : false; }; this.shouldManipulateTarget = function () { - return (_this.getDominantTrigger() > TRIGGER_ON_VALUE) ? true : false; + return (_this.getOffHandTrigger() > TRIGGER_ON_VALUE) ? true : false; }; @@ -486,7 +486,7 @@ Script.include("/~/system/libraries/controllers.js"); }; this.isReady = function (controllerData) { - if (HMD.active && this.hand === this.getOffHand()) { + if (HMD.active && this.hand === this.getDominantHand()) { if (this.notPointingAtEntity(controllerData)) { return makeRunningValues(false, [], []); } diff --git a/scripts/system/controllers/controllerModules/teleport.js b/scripts/system/controllers/controllerModules/teleport.js index 9dcb456541..cd04dc9fd7 100644 --- a/scripts/system/controllers/controllerModules/teleport.js +++ b/scripts/system/controllers/controllerModules/teleport.js @@ -718,7 +718,7 @@ Script.include("/~/system/libraries/controllers.js"); } this.showReticle = function () { - return (_this.getOffhandY() > TELEPORT_DEADZONE) ? true : false; + return (_this.getDominantY() > TELEPORT_DEADZONE) ? true : false; }; this.shouldTeleport = function () { @@ -727,7 +727,7 @@ Script.include("/~/system/libraries/controllers.js"); this.shouldCancel = function () { //return (_this.getDominantY() < -TELEPORT_DEADZONE || _this.getOffhandY() < -TELEPORT_DEADZONE) ? true : false; - return (_this.getOffhandY() <= TELEPORT_DEADZONE) ? true : false; + return (_this.getDominantY() <= TELEPORT_DEADZONE) ? true : false; }; this.parameters = makeDispatcherModuleParameters( @@ -746,7 +746,7 @@ Script.include("/~/system/libraries/controllers.js"); } var otherModule = this.getOtherModule(); - if (!this.disabled && this.showReticle() && !otherModule.active && this.hand === this.getOffHand()) { + if (!this.disabled && this.showReticle() && !otherModule.active && this.hand === this.getDominantHand()) { this.active = true; this.enterTeleport(); return makeRunningValues(true, [], []);