Fix notion of hand dominance.

This commit is contained in:
r3tk0n 2019-02-27 08:39:35 -08:00
parent 7c515ccd45
commit fcdfae5a67
3 changed files with 72 additions and 72 deletions

View file

@ -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" },

View file

@ -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, [], []);
}

View file

@ -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, [], []);