mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:28:02 +02:00
add special equip for oculus style grab
This commit is contained in:
parent
13e03b35cc
commit
0a024616cc
1 changed files with 20 additions and 5 deletions
|
@ -823,7 +823,7 @@ function MyController(hand) {
|
||||||
if (this.hand === RIGHT_HAND && this.state === STATE_SEARCHING && this.getOtherHandController().state === STATE_SEARCHING) {
|
if (this.hand === RIGHT_HAND && this.state === STATE_SEARCHING && this.getOtherHandController().state === STATE_SEARCHING) {
|
||||||
this.maybeScaleMyAvatar();
|
this.maybeScaleMyAvatar();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.ignoreInput()) {
|
if (this.ignoreInput()) {
|
||||||
this.turnOffVisualizations();
|
this.turnOffVisualizations();
|
||||||
return;
|
return;
|
||||||
|
@ -1063,11 +1063,16 @@ function MyController(hand) {
|
||||||
this.secondaryPress = function(value) {
|
this.secondaryPress = function(value) {
|
||||||
_this.rawSecondaryValue = value;
|
_this.rawSecondaryValue = value;
|
||||||
|
|
||||||
// The value to check if we will allow the release function to be called
|
if (_this.state == STATE_HOLD && !this.secondaryHeldEquip) {
|
||||||
var allowReleaseValue = 0.1;
|
// when using the index trigger click equip
|
||||||
if (value > 0 && _this.state == STATE_HOLD) {
|
// any click on the middle finger trigger should release
|
||||||
_this.release();
|
// check if the middle finger trigger is pressed past the threshold
|
||||||
|
var allowReleaseValue = 0.1;
|
||||||
|
if (value > allowReleaseValue) {
|
||||||
|
_this.release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.updateSmoothedTrigger = function() {
|
this.updateSmoothedTrigger = function() {
|
||||||
|
@ -1095,6 +1100,12 @@ function MyController(hand) {
|
||||||
|
|
||||||
this.secondaryReleased = function() {
|
this.secondaryReleased = function() {
|
||||||
return _this.rawSecondaryValue < BUMPER_ON_VALUE;
|
return _this.rawSecondaryValue < BUMPER_ON_VALUE;
|
||||||
|
|
||||||
|
if (_this.state == STATE_HOLD && this.secondaryHeldEquip) {
|
||||||
|
// when using the middle finger hold equip, the equip is
|
||||||
|
// dropped when the middle finger trigger is released
|
||||||
|
_this.release();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// this.triggerOrsecondarySqueezed = function () {
|
// this.triggerOrsecondarySqueezed = function () {
|
||||||
|
@ -1502,6 +1513,10 @@ function MyController(hand) {
|
||||||
this.grabbedHotspot = potentialEquipHotspot;
|
this.grabbedHotspot = potentialEquipHotspot;
|
||||||
this.grabbedEntity = potentialEquipHotspot.entityID;
|
this.grabbedEntity = potentialEquipHotspot.entityID;
|
||||||
this.setState(STATE_HOLD, "equipping '" + entityPropertiesCache.getProps(this.grabbedEntity).name + "'");
|
this.setState(STATE_HOLD, "equipping '" + entityPropertiesCache.getProps(this.grabbedEntity).name + "'");
|
||||||
|
|
||||||
|
// handle the Oculus Touch equip where the middle finger trigger is held
|
||||||
|
this.secondaryHeldEquip = this.secondarySqueezed && !this.triggerSmoothedGrab;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue