mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 09:33:45 +02:00
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:
parent
967c50ab93
commit
2ce72d554b
1 changed files with 2 additions and 7 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue