mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 08:56:25 +02:00
rename function for better clarity
This commit is contained in:
parent
a12034cb45
commit
2d199fe3d0
3 changed files with 4 additions and 4 deletions
|
@ -4679,7 +4679,7 @@ void Application::packetSent(quint64 length) {
|
||||||
|
|
||||||
void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scriptEngine) {
|
void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scriptEngine) {
|
||||||
|
|
||||||
scriptEngine->setPhysicsEnabledFunction([this]() {
|
scriptEngine->setEmitScriptUpdatesFunction([this]() {
|
||||||
return isPhysicsEnabled();
|
return isPhysicsEnabled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -894,7 +894,7 @@ void ScriptEngine::run() {
|
||||||
qint64 now = usecTimestampNow();
|
qint64 now = usecTimestampNow();
|
||||||
|
|
||||||
// we check for 'now' in the past in case people set their clock back
|
// we check for 'now' in the past in case people set their clock back
|
||||||
if (_isPhysicsEnabledFunc() && _lastUpdate < now) {
|
if (_emitScriptUpdates() && _lastUpdate < now) {
|
||||||
float deltaTime = (float) (now - _lastUpdate) / (float) USECS_PER_SECOND;
|
float deltaTime = (float) (now - _lastUpdate) / (float) USECS_PER_SECOND;
|
||||||
if (!_isFinished) {
|
if (!_isFinished) {
|
||||||
auto preUpdate = clock::now();
|
auto preUpdate = clock::now();
|
||||||
|
|
|
@ -168,7 +168,7 @@ public:
|
||||||
// NOTE - this is used by the TypedArray implemetation. we need to review this for thread safety
|
// NOTE - this is used by the TypedArray implemetation. we need to review this for thread safety
|
||||||
ArrayBufferClass* getArrayBufferClass() { return _arrayBufferClass; }
|
ArrayBufferClass* getArrayBufferClass() { return _arrayBufferClass; }
|
||||||
|
|
||||||
void setPhysicsEnabledFunction(std::function<bool()> func) { _isPhysicsEnabledFunc = func; }
|
void setEmitScriptUpdatesFunction(std::function<bool()> func) { _emitScriptUpdates = func; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void callAnimationStateHandler(QScriptValue callback, AnimVariantMap parameters, QStringList names, bool useNames, AnimVariantResultHandler resultHandler);
|
void callAnimationStateHandler(QScriptValue callback, AnimVariantMap parameters, QStringList names, bool useNames, AnimVariantResultHandler resultHandler);
|
||||||
|
@ -239,7 +239,7 @@ protected:
|
||||||
void doWithEnvironment(const EntityItemID& entityID, const QUrl& sandboxURL, std::function<void()> operation);
|
void doWithEnvironment(const EntityItemID& entityID, const QUrl& sandboxURL, std::function<void()> operation);
|
||||||
void callWithEnvironment(const EntityItemID& entityID, const QUrl& sandboxURL, QScriptValue function, QScriptValue thisObject, QScriptValueList args);
|
void callWithEnvironment(const EntityItemID& entityID, const QUrl& sandboxURL, QScriptValue function, QScriptValue thisObject, QScriptValueList args);
|
||||||
|
|
||||||
std::function<bool()> _isPhysicsEnabledFunc{ [](){ return true; } };
|
std::function<bool()> _emitScriptUpdates{ [](){ return true; } };
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue