mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 05:37:26 +02:00
try to keep far grab from getting stuck if the entity is brought very near to the grab-point
This commit is contained in:
parent
0f98c51d89
commit
ecb0669972
1 changed files with 7 additions and 1 deletions
|
@ -1759,6 +1759,12 @@ function MyController(hand) {
|
|||
this.grabRadius * RADIAL_GRAB_AMPLIFIER);
|
||||
}
|
||||
|
||||
// don't let grabRadius go all the way to zero, because it can't come back from that
|
||||
var MINIMUM_GRAB_RADIUS = 0.1;
|
||||
if (this.grabRadius < MINIMUM_GRAB_RADIUS) {
|
||||
this.grabRadius = MINIMUM_GRAB_RADIUS;
|
||||
}
|
||||
|
||||
var newTargetPosition = Vec3.multiply(this.grabRadius, Quat.getUp(worldControllerRotation));
|
||||
newTargetPosition = Vec3.sum(newTargetPosition, worldControllerPosition);
|
||||
|
||||
|
|
Loading…
Reference in a new issue