mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 20:35:17 +02:00
only use hand-sphere vs equipped-item bounding box when deciding to auto-unequip
This commit is contained in:
parent
e59c010642
commit
090a0a6e9a
1 changed files with 1 additions and 14 deletions
|
@ -223,17 +223,6 @@ CONTROLLER_STATE_MACHINE[STATE_FAR_TRIGGER] = {
|
||||||
updateMethod: "farTrigger"
|
updateMethod: "farTrigger"
|
||||||
};
|
};
|
||||||
|
|
||||||
function getMaxDimensions(props) {
|
|
||||||
var maxDimension = props.dimensions.x;
|
|
||||||
if (props.dimensions.y > maxDimension) {
|
|
||||||
maxDimension = props.dimensions.y;
|
|
||||||
}
|
|
||||||
if (props.dimensions.z > maxDimension) {
|
|
||||||
maxDimension = props.dimensions.z;
|
|
||||||
}
|
|
||||||
return maxDimension;
|
|
||||||
}
|
|
||||||
|
|
||||||
function stateToName(state) {
|
function stateToName(state) {
|
||||||
return CONTROLLER_STATE_MACHINE[state] ? CONTROLLER_STATE_MACHINE[state].name : "???";
|
return CONTROLLER_STATE_MACHINE[state] ? CONTROLLER_STATE_MACHINE[state].name : "???";
|
||||||
}
|
}
|
||||||
|
@ -1845,9 +1834,7 @@ function MyController(hand) {
|
||||||
if (now - this.lastUnequipCheckTime > MSECS_PER_SEC * CHECK_TOO_FAR_UNEQUIP_TIME) {
|
if (now - this.lastUnequipCheckTime > MSECS_PER_SEC * CHECK_TOO_FAR_UNEQUIP_TIME) {
|
||||||
this.lastUnequipCheckTime = now;
|
this.lastUnequipCheckTime = now;
|
||||||
|
|
||||||
var maxDimension = getMaxDimensions(props);
|
if (props.parentID == MyAvatar.sessionUUID) {
|
||||||
if (props.parentID == MyAvatar.sessionUUID &&
|
|
||||||
Vec3.length(props.localPosition) > maxDimension * AUTO_UNEQUIP_DISTANCE_FACTOR) {
|
|
||||||
var handPosition = this.getHandPosition();
|
var handPosition = this.getHandPosition();
|
||||||
// the center of the equipped object being far from the hand isn't enough to auto-unequip -- we also
|
// the center of the equipped object being far from the hand isn't enough to auto-unequip -- we also
|
||||||
// need to fail the findEntities test.
|
// need to fail the findEntities test.
|
||||||
|
|
Loading…
Reference in a new issue