fixing cloning and laser

This commit is contained in:
druiz17 2017-09-08 17:07:27 -07:00
parent 42ef397b5e
commit 405d8c3afc
4 changed files with 6 additions and 7 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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

View file

@ -36,7 +36,6 @@ entityIsCloneable = function(props) {
var grabbableData = getGrabbableData(props);
return grabbableData.cloneable;
}
return false;
};