Recenter body on teleport, also it works more consistently.

If your avatar happens to be squatting, your body will stand up straight after you teleport.
Also, setting MyAvatar.position can sometimes fail due to the multi-threaded nature of scripting.
Instead, teleport.js uses goToPosition to move the avatar, as a result teleport feels much more responsive now.
This commit is contained in:
Anthony J. Thibault 2017-04-04 18:05:46 -07:00
parent 384f404602
commit c33f10ca1b

View file

@ -297,8 +297,9 @@ function Teleporter() {
} else if (teleportLocationType === TARGET.SURFACE) {
var offset = getAvatarFootOffset();
intersection.intersection.y += offset;
MyAvatar.position = intersection.intersection;
MyAvatar.goToLocation(intersection.intersection, false, {x: 0, y: 0, z: 0, w: 1}, false);
HMD.centerUI();
MyAvatar.centerBody();
}
}
};