mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 04:34:38 +02:00
Cope with slight avatar position and orientation jitter when stationary
This commit is contained in:
parent
81e1dd4d6a
commit
a1056f34ed
1 changed files with 7 additions and 8 deletions
|
@ -25,6 +25,9 @@ var ALTITUDE_RATE = 200.0;
|
|||
var RADIUS_RATE = 1.0 / 100.0;
|
||||
var PAN_RATE = 250.0;
|
||||
|
||||
var AVATAR_POSITION_SLOP = 0.1;
|
||||
var AVATAR_ROTATION_SLOP = 0.09; // 5 degrees
|
||||
|
||||
var Y_AXIS = {
|
||||
x: 0,
|
||||
y: 1,
|
||||
|
@ -179,14 +182,10 @@ function handleModes() {
|
|||
avatarOrientation = MyAvatar.orientation;
|
||||
}
|
||||
// if leaving detachMode
|
||||
if (mode === detachedMode && newMode === detachedMode &&
|
||||
(avatarPosition.x !== MyAvatar.position.x ||
|
||||
avatarPosition.y !== MyAvatar.position.y ||
|
||||
avatarPosition.z !== MyAvatar.position.z ||
|
||||
avatarOrientation.x !== MyAvatar.orientation.x ||
|
||||
avatarOrientation.y !== MyAvatar.orientation.y ||
|
||||
avatarOrientation.z !== MyAvatar.orientation.z ||
|
||||
avatarOrientation.w !== MyAvatar.orientation.w)) {
|
||||
if (mode === detachedMode && newMode === detachedMode && (
|
||||
Vec3.length(Vec3.subtract(avatarPosition, MyAvatar.position)) > AVATAR_POSITION_SLOP
|
||||
|| Vec3.length(Vec3.subtract(Quat.getFront(avatarOrientation), Quat.getFront(MyAvatar.orientation)))
|
||||
> AVATAR_ROTATION_SLOP)) {
|
||||
newMode = noMode;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue