First-pass attempt at remedying the smoothing issue (the avatar is never receiving the proper call).

This commit is contained in:
trent 2017-04-20 13:21:38 -04:00
parent 788849e19a
commit 805a74c074
2 changed files with 9 additions and 5 deletions

View file

@ -358,7 +358,9 @@ void Avatar::simulate(float deltaTime, bool inView) {
);
updateAttitude();
}
}
} else if (AvatarData::getPosition() != _smoothPositionTarget) {
setPosition(AvatarData::getPosition());
}
if (_smoothOrientationTimer < _smoothOrientationTime) {
// Smooth the remote avatar movement.
@ -371,7 +373,9 @@ void Avatar::simulate(float deltaTime, bool inView) {
);
updateAttitude();
}
}
} else if (AvatarData::getOrientation() != _smoothOrientationTarget) {
setOrientation(AvatarData::getOrientation());
}
}
PerformanceTimer perfTimer("simulate");
@ -1386,7 +1390,7 @@ void Avatar::setPosition(const glm::vec3& position) {
}
// Whether or not there is an existing smoothing going on, just reset the smoothing timer and set the starting position as the avatar's current position, then smooth to the new position.
_smoothPositionInitial = getPosition();
_smoothPositionInitial = AvatarData::getPosition();
_smoothPositionTarget = position;
_smoothPositionTimer = 0.0f;
}
@ -1400,7 +1404,7 @@ void Avatar::setOrientation(const glm::quat& orientation) {
}
// Whether or not there is an existing smoothing going on, just reset the smoothing timer and set the starting position as the avatar's current position, then smooth to the new position.
_smoothOrientationInitial = getOrientation();
_smoothOrientationInitial = AvatarData::getOrientation();
_smoothOrientationTarget = orientation;
_smoothOrientationTimer = 0.0f;
}

View file

@ -253,7 +253,7 @@ protected:
friend class AvatarManager;
const float SMOOTH_TIME_POSITION = 0.125f;
const float SMOOTH_TIME_ORIENTATION = 0.075f;
const float SMOOTH_TIME_ORIENTATION = 0.15f;
virtual const QString& getSessionDisplayNameForTransport() const override { return _empty; } // Save a tiny bit of bandwidth. Mixer won't look at what we send.
QString _empty{};