mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-19 09:18:20 +02:00
Avatar Sim Rate Display fix
Division by zero on first update was causing the displayed avatar simulation rate to be incorrect.
This commit is contained in:
parent
2c886658ba
commit
71f1be2b38
1 changed files with 3 additions and 1 deletions
|
@ -44,9 +44,11 @@ void AvatarUpdate::synchronousProcess() {
|
|||
bool AvatarUpdate::process() {
|
||||
PerformanceTimer perfTimer("AvatarUpdate");
|
||||
quint64 start = usecTimestampNow();
|
||||
quint64 deltaMicroseconds = 0;
|
||||
quint64 deltaMicroseconds = 10000;
|
||||
if (_lastAvatarUpdate > 0) {
|
||||
deltaMicroseconds = start - _lastAvatarUpdate;
|
||||
} else {
|
||||
deltaMicroseconds = 10000; // 10 ms
|
||||
}
|
||||
float deltaSeconds = (float) deltaMicroseconds / (float) USECS_PER_SECOND;
|
||||
_lastAvatarUpdate = start;
|
||||
|
|
Loading…
Reference in a new issue