From 405d8c3afc335028d9ef1043b6a86620808a1f7b Mon Sep 17 00:00:00 2001 From: druiz17 Date: Fri, 8 Sep 2017 17:07:27 -0700 Subject: [PATCH] fixing cloning and laser --- .../controllers/controllerModules/farActionGrabEntity.js | 6 +++--- .../controllers/controllerModules/nearActionGrabEntity.js | 4 ++-- .../controllers/controllerModules/tabletStylusInput.js | 2 +- scripts/system/libraries/cloneEntityUtils.js | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/system/controllers/controllerModules/farActionGrabEntity.js b/scripts/system/controllers/controllerModules/farActionGrabEntity.js index 56513ab766..3355901e6e 100644 --- a/scripts/system/controllers/controllerModules/farActionGrabEntity.js +++ b/scripts/system/controllers/controllerModules/farActionGrabEntity.js @@ -137,7 +137,7 @@ Script.include("/~/system/libraries/controllers.js"); var dim = {x: radius, y: radius, z: radius}; var mode = "hold"; if (!this.distanceHolding && !this.distanceRotating) { - if (controllerData.triggerClicks[this.hand]) { + if (controllerData.triggerValues[this.hand] === 1) { mode = "full"; } else { mode = "half"; @@ -367,8 +367,6 @@ Script.include("/~/system/libraries/controllers.js"); otherFarGrabModule.offsetPosition = Vec3.multiplyQbyV(controllerRotationDelta, otherFarGrabModule.offsetPosition); - this.updateLaserPointer(); - this.previousWorldControllerRotation = worldControllerRotation; }; @@ -434,6 +432,8 @@ Script.include("/~/system/libraries/controllers.js"); return makeRunningValues(false, [], []); } + this.updateLaserPointer(controllerData); + var otherModuleName =this.hand === RIGHT_HAND ? "LeftFarActionGrabEntity" : "RightFarActionGrabEntity"; var otherFarGrabModule = getEnabledModuleByName(otherModuleName); diff --git a/scripts/system/controllers/controllerModules/nearActionGrabEntity.js b/scripts/system/controllers/controllerModules/nearActionGrabEntity.js index 932cbda179..802540af17 100644 --- a/scripts/system/controllers/controllerModules/nearActionGrabEntity.js +++ b/scripts/system/controllers/controllerModules/nearActionGrabEntity.js @@ -152,7 +152,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); if (distance > NEAR_GRAB_RADIUS) { break; } - if (entityIsGrabbable(props)) { + if (entityIsGrabbable(props) || entityIsCloneable(props)) { // if we've attempted to grab a child, roll up to the root of the tree var groupRootProps = findGroupParent(controllerData, props); if (entityIsGrabbable(groupRootProps)) { @@ -173,7 +173,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); var targetProps = this.getTargetProps(controllerData); if (targetProps) { - if (!propsArePhysical(targetProps) && !propsAreCloneDynamic) { + if (!propsArePhysical(targetProps) && !propsAreCloneDynamic(targetProps)) { return makeRunningValues(false, [], []); // let nearParentGrabEntity handle it } else { this.targetEntityID = targetProps.id; diff --git a/scripts/system/controllers/controllerModules/tabletStylusInput.js b/scripts/system/controllers/controllerModules/tabletStylusInput.js index a70b9867d8..8a1262bac0 100644 --- a/scripts/system/controllers/controllerModules/tabletStylusInput.js +++ b/scripts/system/controllers/controllerModules/tabletStylusInput.js @@ -20,7 +20,7 @@ Script.include("/~/system/libraries/controllers.js"); var HAPTIC_STYLUS_STRENGTH = 1.0; var HAPTIC_STYLUS_DURATION = 20.0; - var WEB_DISPLAY_STYLUS_DISTANCE = 0.2; + var WEB_DISPLAY_STYLUS_DISTANCE = 0.1; var WEB_STYLUS_LENGTH = 0.2; var WEB_TOUCH_Y_OFFSET = 0.05; // how far forward (or back with a negative number) to slide stylus in hand diff --git a/scripts/system/libraries/cloneEntityUtils.js b/scripts/system/libraries/cloneEntityUtils.js index 26d8051f89..500c6a0696 100644 --- a/scripts/system/libraries/cloneEntityUtils.js +++ b/scripts/system/libraries/cloneEntityUtils.js @@ -36,7 +36,6 @@ entityIsCloneable = function(props) { var grabbableData = getGrabbableData(props); return grabbableData.cloneable; } - return false; };