Can't resize if objects in both hands, avatar resize is seek + grips

This commit is contained in:
Philip Rosedale 2016-12-14 13:38:37 -08:00
parent 9370c8af6b
commit 14c867fdbd

View file

@ -773,8 +773,8 @@ function MyController(hand) {
this.updateSmoothedTrigger(); this.updateSmoothedTrigger();
// If both grip buttons squeezed and nothing is held, rescale my avatar! // If both trigger and grip buttons squeezed and nothing is held, rescale my avatar!
if (this.hand === RIGHT_HAND && this.state === STATE_OFF && this.getOtherHandController().state === STATE_OFF) { if (this.hand === RIGHT_HAND && this.state === STATE_SEARCHING && this.getOtherHandController().state === STATE_SEARCHING) {
this.maybeScaleMyAvatar(); this.maybeScaleMyAvatar();
} }
@ -2191,8 +2191,8 @@ function MyController(hand) {
this.maybeScale = function(props) { this.maybeScale = function(props) {
if (!this.shouldScale) { if (!this.shouldScale) {
// If both secondary triggers squeezed, start scaling // If both secondary triggers squeezed, and the non-holding hand is empty, start scaling
if (this.secondarySqueezed() && this.getOtherHandController().secondarySqueezed()) { if (this.secondarySqueezed() && this.getOtherHandController().secondarySqueezed() && this.getOtherHandController().state === STATE_OFF) {
this.scalingStartDistance = Vec3.length(Vec3.subtract(this.getHandPosition(), this.getOtherHandController().getHandPosition())); this.scalingStartDistance = Vec3.length(Vec3.subtract(this.getHandPosition(), this.getOtherHandController().getHandPosition()));
this.scalingStartDimensions = props.dimensions; this.scalingStartDimensions = props.dimensions;
this.shouldScale = true; this.shouldScale = true;