Fixing spray can script

This commit is contained in:
Brad Davis 2015-10-26 12:47:31 -07:00
parent aaaee30032
commit d91d0a2027

View file

@ -33,12 +33,17 @@
var MIN_POINT_DISTANCE = 0.01; var MIN_POINT_DISTANCE = 0.01;
var STROKE_WIDTH = 0.02; var STROKE_WIDTH = 0.02;
var TRIGGER_CONTROLS = [
Controller.Standard.LT,
Controller.Standard.RT,
];
this.setRightHand = function () { this.setRightHand = function () {
this.hand = 'RIGHT'; this.hand = 1;
} }
this.setLeftHand = function () { this.setLeftHand = function () {
this.hand = 'LEFT'; this.hand = 0;
} }
this.startNearGrab = function () { this.startNearGrab = function () {
@ -46,11 +51,7 @@
} }
this.toggleWithTriggerPressure = function () { this.toggleWithTriggerPressure = function () {
var handClickString = this.whichHand + "_HAND_CLICK"; this.triggerValue = Controller.getValue(TRIGGER_CONTROLS[this.whichHand]);
var handClick = Controller.findAction(handClickString);
this.triggerValue = Controller.getActionValue(handClick);
if (this.triggerValue < DISABLE_SPRAY_THRESHOLD && this.spraying === true) { if (this.triggerValue < DISABLE_SPRAY_THRESHOLD && this.spraying === true) {
this.spraying = false; this.spraying = false;
this.disableStream(); this.disableStream();