mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-10 08:06:26 +02:00
Add ability to disable avatar and object scaling in handController grab
This commit is contained in:
parent
8325c96c0c
commit
df0dfc761d
1 changed files with 18 additions and 0 deletions
|
@ -195,6 +195,8 @@ var STATE_OVERLAY_TOUCHING = 8;
|
||||||
var holdEnabled = true;
|
var holdEnabled = true;
|
||||||
var nearGrabEnabled = true;
|
var nearGrabEnabled = true;
|
||||||
var farGrabEnabled = true;
|
var farGrabEnabled = true;
|
||||||
|
var myAvatarScalingEnabled = true;
|
||||||
|
var objectScalingEnabled = true;
|
||||||
|
|
||||||
// "collidesWith" is specified by comma-separated list of group names
|
// "collidesWith" is specified by comma-separated list of group names
|
||||||
// the possible group names are: static, dynamic, kinematic, myAvatar, otherAvatar
|
// the possible group names are: static, dynamic, kinematic, myAvatar, otherAvatar
|
||||||
|
@ -2314,6 +2316,10 @@ function MyController(hand) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.maybeScale = function(props) {
|
this.maybeScale = function(props) {
|
||||||
|
if (!objectScalingEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.shouldScale) {
|
if (!this.shouldScale) {
|
||||||
// If both secondary triggers squeezed, and the non-holding hand is empty, start scaling
|
// 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) {
|
if (this.secondarySqueezed() && this.getOtherHandController().secondarySqueezed() && this.getOtherHandController().state === STATE_OFF) {
|
||||||
|
@ -2333,6 +2339,10 @@ function MyController(hand) {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.maybeScaleMyAvatar = function() {
|
this.maybeScaleMyAvatar = function() {
|
||||||
|
if (!myAvatarScalingEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.shouldScale) {
|
if (!this.shouldScale) {
|
||||||
// If both secondary triggers squeezed, start scaling
|
// If both secondary triggers squeezed, start scaling
|
||||||
if (this.secondarySqueezed() && this.getOtherHandController().secondarySqueezed()) {
|
if (this.secondarySqueezed() && this.getOtherHandController().secondarySqueezed()) {
|
||||||
|
@ -3018,6 +3028,14 @@ var handleHandMessages = function(channel, message, sender) {
|
||||||
print("farGrabEnabled: ", data.farGrabEnabled);
|
print("farGrabEnabled: ", data.farGrabEnabled);
|
||||||
farGrabEnabled = data.farGrabEnabled;
|
farGrabEnabled = data.farGrabEnabled;
|
||||||
}
|
}
|
||||||
|
if (data.myAvatarScalingEnabled !== undefined) {
|
||||||
|
print("myAvatarScalingEnabled: ", data.myAvatarScalingEnabled);
|
||||||
|
myAvatarScalingEnabled = data.myAvatarScalingEnabled;
|
||||||
|
}
|
||||||
|
if (data.objectScalingEnabled !== undefined) {
|
||||||
|
print("objectScalingEnabled: ", data.objectScalingEnabled);
|
||||||
|
objectScalingEnabled = data.objectScalingEnabled;
|
||||||
|
}
|
||||||
} else if (channel === 'Hifi-Hand-Grab') {
|
} else if (channel === 'Hifi-Hand-Grab') {
|
||||||
try {
|
try {
|
||||||
data = JSON.parse(message);
|
data = JSON.parse(message);
|
||||||
|
|
Loading…
Reference in a new issue