Initial Commit :

1) Resolve a bug when 2 different entity is grabbed in 2 hands. And move your left hand and entity of left hand grow/shrink when you move right/left hand.
2) Resolve right hand-left hand grow-shrink functionality
This commit is contained in:
NeetBhagat 2017-06-02 23:04:58 +05:30
parent 9a80a81321
commit 580c2548e9

View file

@ -3330,11 +3330,17 @@ 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() &&
this.getOtherHandController().state === STATE_OFF) {
isSameEntityInBothControllers) {
this.scalingStartDistance = Vec3.length(Vec3.subtract(this.getHandPosition(),
this.getOtherHandController().getHandPosition()));
this.scalingStartDimensions = props.dimensions;