mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-08 07:02:25 +02:00
Fix rare case where script would fail to set LOD after disabling auto LOD
This commit is contained in:
parent
4b5a45209e
commit
94e725dc2a
2 changed files with 5 additions and 0 deletions
|
@ -54,6 +54,7 @@ void LODManager::setRenderTimes(float presentTime, float engineRunTime, float ba
|
|||
}
|
||||
|
||||
void LODManager::autoAdjustLOD(float realTimeDelta) {
|
||||
std::lock_guard<std::mutex> { _automaticLODLock };
|
||||
|
||||
// The "render time" is the worse of:
|
||||
// - engineRunTime: Time spent in the render thread in the engine producing the gpu::Frame N
|
||||
|
@ -235,6 +236,7 @@ void LODManager::resetLODAdjust() {
|
|||
}
|
||||
|
||||
void LODManager::setAutomaticLODAdjust(bool value) {
|
||||
std::lock_guard<std::mutex> { _automaticLODLock };
|
||||
_automaticLODAdjust = value;
|
||||
emit autoLODChanged();
|
||||
}
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#ifndef hifi_LODManager_h
|
||||
#define hifi_LODManager_h
|
||||
|
||||
#include <mutex>
|
||||
|
||||
#include <DependencyManager.h>
|
||||
#include <NumericalConstants.h>
|
||||
#include <OctreeConstants.h>
|
||||
|
@ -230,6 +232,7 @@ signals:
|
|||
private:
|
||||
LODManager();
|
||||
|
||||
std::mutex _automaticLODLock;
|
||||
bool _automaticLODAdjust = true;
|
||||
|
||||
float _presentTime{ 0.0f }; // msec
|
||||
|
|
Loading…
Reference in a new issue