mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 21:53:12 +02:00
AvatarUpdate: fix for very large dt
This was affecting threaded avatar update when enabled.
This commit is contained in:
parent
e2d9e37eb8
commit
f922f61c3d
2 changed files with 7 additions and 3 deletions
|
@ -356,7 +356,8 @@ void AvatarManager::handleCollisionEvents(const CollisionEvents& collisionEvents
|
|||
|
||||
AudioInjector::playSound(collisionSoundURL, energyFactorOfFull, AVATAR_STRETCH_FACTOR, myAvatar->getPosition());
|
||||
myAvatar->collisionWithEntity(collision);
|
||||
return; }
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,9 +44,12 @@ void AvatarUpdate::synchronousProcess() {
|
|||
bool AvatarUpdate::process() {
|
||||
PerformanceTimer perfTimer("AvatarUpdate");
|
||||
quint64 start = usecTimestampNow();
|
||||
quint64 deltaMicroseconds = start - _lastAvatarUpdate;
|
||||
_lastAvatarUpdate = start;
|
||||
quint64 deltaMicroseconds = 0;
|
||||
if (_lastAvatarUpdate > 0) {
|
||||
deltaMicroseconds = start - _lastAvatarUpdate;
|
||||
}
|
||||
float deltaSeconds = (float) deltaMicroseconds / (float) USECS_PER_SECOND;
|
||||
_lastAvatarUpdate = start;
|
||||
qApp->setAvatarSimrateSample(1.0f / deltaSeconds);
|
||||
|
||||
QSharedPointer<AvatarManager> manager = DependencyManager::get<AvatarManager>();
|
||||
|
|
Loading…
Reference in a new issue