Resolve 2 issues:

1) Entity can grow/shrink if it is grabbed by first right hand then left hand.
2) Stop unwanted grow/shrink of an entity.
This commit is contained in:
NeetBhagat 2017-06-05 14:11:53 +05:30
parent 967c50ab93
commit 2ce72d554b

View file

@ -3330,17 +3330,12 @@ function MyController(hand) {
return;
}
var isSameEntityInBothControllers = false;
if (leftController.grabbedThingID && rightController.grabbedThingID &&
leftController.grabbedThingID == rightController.grabbedThingID) {
isSameEntityInBothControllers = true;
}
if (!this.shouldScale) {
// If both secondary triggers squeezed, and the non-holding hand is empty, start scaling
if (this.secondarySqueezed() &&
this.getOtherHandController().secondarySqueezed() &&
isSameEntityInBothControllers) {
this.grabbedThingID && this.getOtherHandController().grabbedThingID &&
this.grabbedThingID == this.getOtherHandController().grabbedThingID) {
this.scalingStartDistance = Vec3.length(Vec3.subtract(this.getHandPosition(),
this.getOtherHandController().getHandPosition()));
this.scalingStartDimensions = props.dimensions;