adding check function for pointing at near grabbable entity

This commit is contained in:
Wayne Chen 2018-07-23 12:29:01 -07:00
parent 1ec136a19c
commit e4a5be668a
2 changed files with 2 additions and 4 deletions

View file

@ -48,7 +48,6 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
this.tabletID = null;
this.blacklist = [];
this.pointerManager = new PointerManager();
this.debugOverlayID = null;
// a module can occupy one or more "activity" slots while it's running. If all the required slots for a module are
// not set to false (not in use), a module cannot start. When a module is using a slot, that module's name
@ -378,7 +377,6 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
}
}
_this.pointerManager.updatePointersRenderState(controllerData.triggerClicks, controllerData.triggerValues);
if (PROFILE) {
Script.endProfileRange("dispatch.run");
}

View file

@ -123,7 +123,7 @@ Script.include("/~/system/libraries/controllers.js");
controllerData.triggerValues[this.otherHand] <= TRIGGER_OFF_VALUE;
var allowThisModule = !otherModuleRunning || isTriggerPressed;
if (allowThisModule && this.isPointingAtTriggerable(controllerData, isTriggerPressed) &&
(controllerData.nearbyEntityProperties[this.hand] !== [])) {
!this.isPointingAtNearGrabbableEntity(controllerData, isTriggerPressed)) {
this.updateAllwaysOn();
if (isTriggerPressed) {
this.dominantHandOverride = true; // Override dominant hand.
@ -145,7 +145,7 @@ Script.include("/~/system/libraries/controllers.js");
var isTriggerPressed = controllerData.triggerValues[this.hand] > TRIGGER_OFF_VALUE;
var laserOn = isTriggerPressed || this.parameters.handLaser.allwaysOn;
if (allowThisModule && (laserOn && this.isPointingAtTriggerable(controllerData, isTriggerPressed)) &&
(controllerData.nearbyEntityProperties[this.hand] !== [])) {
!this.isPointingAtNearGrabbableEntity(controllerData, isTriggerPressed)) {
this.running = true;
return makeRunningValues(true, [], []);
}