mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 14:29:50 +02:00
remove extra joint search
This commit is contained in:
parent
921242fbe5
commit
6af21525d5
1 changed files with 5 additions and 8 deletions
|
@ -399,14 +399,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isNearby(id, handString) {
|
function isNearby() {
|
||||||
if (currentHand) {
|
if (currentHand) {
|
||||||
var handPosition = getHandPosition(MyAvatar, currentHandJointIndex);
|
var handPosition = getHandPosition(MyAvatar, currentHandJointIndex);
|
||||||
var avatar = AvatarList.getAvatar(id);
|
var avatar = AvatarList.getAvatar(connectingId);
|
||||||
if (avatar) {
|
if (avatar) {
|
||||||
var otherHand = stringToHand(handString);
|
var distance = Vec3.distance(getHandPosition(avatar, connectingHandJointIndex), handPosition);
|
||||||
var otherHandJointIndex = getIdealHandJointIndex(avatar, otherHand);
|
|
||||||
var distance = Vec3.distance(getHandPosition(avatar, otherHandJointIndex), handPosition);
|
|
||||||
return (distance < MAX_AVATAR_DISTANCE);
|
return (distance < MAX_AVATAR_DISTANCE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -728,7 +726,7 @@
|
||||||
if (state !== STATES.CONNECTING) {
|
if (state !== STATES.CONNECTING) {
|
||||||
debug("stopping connecting interval, state changed");
|
debug("stopping connecting interval, state changed");
|
||||||
stopConnecting();
|
stopConnecting();
|
||||||
} else if (!isNearby(id, handString)) {
|
} else if (!isNearby()) {
|
||||||
// gotta go back to waiting
|
// gotta go back to waiting
|
||||||
debug(id, "moved, back to waiting");
|
debug(id, "moved, back to waiting");
|
||||||
stopConnecting();
|
stopConnecting();
|
||||||
|
@ -800,9 +798,8 @@
|
||||||
delete waitingList[senderID];
|
delete waitingList[senderID];
|
||||||
if (state === STATES.WAITING && (!connectingId || connectingId === senderID)) {
|
if (state === STATES.WAITING && (!connectingId || connectingId === senderID)) {
|
||||||
if (message.id === MyAvatar.sessionUUID) {
|
if (message.id === MyAvatar.sessionUUID) {
|
||||||
setupConnecting(senderID, message[HAND_STRING_PROPERTY]);
|
|
||||||
stopWaiting();
|
stopWaiting();
|
||||||
startConnecting(senderID, connectingHandString);
|
startConnecting(senderID, message[HAND_STRING_PROPERTY]);
|
||||||
} else if (connectingId) {
|
} else if (connectingId) {
|
||||||
// this is for someone else (we lost race in connectionRequest),
|
// this is for someone else (we lost race in connectionRequest),
|
||||||
// so lets start over
|
// so lets start over
|
||||||
|
|
Loading…
Reference in a new issue