mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into grab-fixes
This commit is contained in:
commit
f5be64ed96
12 changed files with 74 additions and 43 deletions
|
@ -65,7 +65,7 @@ const float ENTITY_ITEM_MAX_RESTITUTION = 0.99f;
|
|||
const float ENTITY_ITEM_DEFAULT_RESTITUTION = 0.5f;
|
||||
|
||||
const float ENTITY_ITEM_MIN_FRICTION = 0.0f;
|
||||
const float ENTITY_ITEM_MAX_FRICTION = 0.99f;
|
||||
const float ENTITY_ITEM_MAX_FRICTION = 10.0f;
|
||||
const float ENTITY_ITEM_DEFAULT_FRICTION = 0.5f;
|
||||
|
||||
const bool ENTITY_ITEM_DEFAULT_COLLISIONLESS = false;
|
||||
|
|
|
@ -36,6 +36,11 @@ Socket::Socket(QObject* parent) :
|
|||
|
||||
// start our timer for the synchronization time interval
|
||||
_synTimer->start(_synInterval);
|
||||
|
||||
// make sure we hear about errors and state changes from the underlying socket
|
||||
connect(&_udpSocket, SIGNAL(error(QAbstractSocket::SocketError)),
|
||||
this, SLOT(handleSocketError(QAbstractSocket::SocketError)));
|
||||
connect(&_udpSocket, &QAbstractSocket::stateChanged, this, &Socket::handleStateChanged);
|
||||
}
|
||||
|
||||
void Socket::bind(const QHostAddress& address, quint16 port) {
|
||||
|
@ -406,3 +411,13 @@ std::vector<HifiSockAddr> Socket::getConnectionSockAddrs() {
|
|||
}
|
||||
return addr;
|
||||
}
|
||||
|
||||
void Socket::handleSocketError(QAbstractSocket::SocketError socketError) {
|
||||
qCWarning(networking) << "udt::Socket error -" << socketError;
|
||||
}
|
||||
|
||||
void Socket::handleStateChanged(QAbstractSocket::SocketState socketState) {
|
||||
if (socketState != QAbstractSocket::BoundState) {
|
||||
qCWarning(networking) << "udt::Socket state changed - state is now" << socketState;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,10 @@ public slots:
|
|||
private slots:
|
||||
void readPendingDatagrams();
|
||||
void rateControlSync();
|
||||
|
||||
|
||||
void handleSocketError(QAbstractSocket::SocketError socketError);
|
||||
void handleStateChanged(QAbstractSocket::SocketState socketState);
|
||||
|
||||
private:
|
||||
void setSystemBufferSizes();
|
||||
Connection& findOrCreateConnection(const HifiSockAddr& sockAddr);
|
||||
|
|
|
@ -46,7 +46,7 @@ void renderShape(RenderArgs* args, const ShapePlumberPointer& shapeContext, cons
|
|||
} else if (key.hasOwnPipeline()) {
|
||||
item.render(args);
|
||||
} else {
|
||||
qDebug() << "Item could not be rendered: invalid key ?" << key;
|
||||
qDebug() << "Item could not be rendered with invalid key" << key;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ void render::renderStateSortShapes(const SceneContextPointer& sceneContext, cons
|
|||
} else if (key.hasOwnPipeline()) {
|
||||
ownPipelineBucket.push_back(item);
|
||||
} else {
|
||||
qDebug() << "Item could not be rendered: invalid key ?" << key;
|
||||
qDebug() << "Item could not be rendered with invalid key" << key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,11 @@ const ShapePipelinePointer ShapePlumber::pickPipeline(RenderArgs* args, const Ke
|
|||
|
||||
const auto& pipelineIterator = _pipelineMap.find(key);
|
||||
if (pipelineIterator == _pipelineMap.end()) {
|
||||
qDebug() << "Couldn't find a pipeline from ShapeKey ?" << key;
|
||||
// The first time we can't find a pipeline, we should log it
|
||||
if (_missingKeys.find(key) == _missingKeys.end()) {
|
||||
_missingKeys.insert(key);
|
||||
qDebug() << "Couldn't find a pipeline for" << key;
|
||||
}
|
||||
return PipelinePointer(nullptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#ifndef hifi_render_ShapePipeline_h
|
||||
#define hifi_render_ShapePipeline_h
|
||||
|
||||
#include <unordered_set>
|
||||
|
||||
#include <gpu/Batch.h>
|
||||
#include <RenderArgs.h>
|
||||
|
||||
|
@ -147,7 +149,7 @@ public:
|
|||
bool hasOwnPipeline() const { return _flags[OWN_PIPELINE]; }
|
||||
bool isValid() const { return !_flags[INVALID]; }
|
||||
|
||||
// Hasher for use in unordered_maps
|
||||
// Comparator for use in stl containers
|
||||
class Hash {
|
||||
public:
|
||||
size_t operator() (const ShapeKey& key) const {
|
||||
|
@ -155,7 +157,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
// Comparator for use in unordered_maps
|
||||
// Comparator for use in stl containers
|
||||
class KeyEqual {
|
||||
public:
|
||||
bool operator()(const ShapeKey& lhs, const ShapeKey& rhs) const { return lhs._flags == rhs._flags; }
|
||||
|
@ -271,7 +273,11 @@ public:
|
|||
protected:
|
||||
void addPipelineHelper(const Filter& filter, Key key, int bit, const PipelinePointer& pipeline);
|
||||
PipelineMap _pipelineMap;
|
||||
|
||||
private:
|
||||
mutable std::unordered_set<Key, Key::Hash, Key::KeyEqual> _missingKeys;
|
||||
};
|
||||
|
||||
using ShapePlumberPointer = std::shared_ptr<ShapePlumber>;
|
||||
|
||||
}
|
||||
|
|
|
@ -146,12 +146,15 @@ ScriptEngine::ScriptEngine(const QString& scriptContents, const QString& fileNam
|
|||
|
||||
ScriptEngine::~ScriptEngine() {
|
||||
qCDebug(scriptengine) << "Script Engine shutting down (destructor) for script:" << getFilename();
|
||||
|
||||
auto scriptEngines = DependencyManager::get<ScriptEngines>();
|
||||
if (scriptEngines) {
|
||||
scriptEngines->removeScriptEngine(this);
|
||||
} else {
|
||||
qCWarning(scriptengine) << "Script destroyed after ScriptEngines!";
|
||||
}
|
||||
|
||||
waitTillDoneRunning();
|
||||
}
|
||||
|
||||
void ScriptEngine::disconnectNonEssentialSignals() {
|
||||
|
@ -172,7 +175,7 @@ void ScriptEngine::runInThread() {
|
|||
}
|
||||
|
||||
_isThreaded = true;
|
||||
QThread* workerThread = new QThread(this); // thread is not owned, so we need to manage the delete
|
||||
QThread* workerThread = new QThread();
|
||||
QString scriptEngineName = QString("Script Thread:") + getFilename();
|
||||
workerThread->setObjectName(scriptEngineName);
|
||||
|
||||
|
@ -194,35 +197,35 @@ void ScriptEngine::runInThread() {
|
|||
|
||||
void ScriptEngine::waitTillDoneRunning() {
|
||||
// If the script never started running or finished running before we got here, we don't need to wait for it
|
||||
if (_isRunning && _isThreaded) {
|
||||
|
||||
// NOTE: waitTillDoneRunning() will be called on the main Application thread, inside of stopAllScripts()
|
||||
// we want the application thread to continue to process events, because the scripts will likely need to
|
||||
// marshall messages across to the main thread. For example if they access Settings or Menu in any of their
|
||||
// shutdown code.
|
||||
auto workerThread = thread();
|
||||
if (_isThreaded && workerThread) {
|
||||
QString scriptName = getFilename();
|
||||
|
||||
auto startedWaiting = usecTimestampNow();
|
||||
while (thread()->isRunning()) {
|
||||
// process events for the main application thread, allowing invokeMethod calls to pass between threads
|
||||
QCoreApplication::processEvents();
|
||||
auto stillWaiting = usecTimestampNow();
|
||||
auto elapsedUsecs = stillWaiting - startedWaiting;
|
||||
|
||||
// if we've been waiting a second or more, then tell the script engine to stop evaluating
|
||||
static const auto MAX_SCRIPT_EVALUATION_TIME = USECS_PER_SECOND;
|
||||
static const auto WAITING_TOO_LONG = MAX_SCRIPT_EVALUATION_TIME * 5;
|
||||
|
||||
// if we've been waiting for more than 5 seconds then we should be more aggessive about stopping
|
||||
if (elapsedUsecs > WAITING_TOO_LONG) {
|
||||
qCDebug(scriptengine) << "Script " << scriptName << " has been running too long [" << elapsedUsecs << " usecs] quitting.";
|
||||
thread()->quit();
|
||||
while (workerThread->isRunning()) {
|
||||
// NOTE: This will be called on the main application thread from stopAllScripts.
|
||||
// The application thread will need to continue to process events, because
|
||||
// the scripts will likely need to marshall messages across to the main thread, e.g.
|
||||
// if they access Settings or Menu in any of their shutdown code. So:
|
||||
// Process events for the main application thread, allowing invokeMethod calls to pass between threads.
|
||||
QCoreApplication::processEvents(); // thread-safe :)
|
||||
|
||||
// If we've been waiting a second or more, then tell the script engine to stop evaluating
|
||||
static const auto MAX_SCRIPT_EVALUATION_TIME = USECS_PER_SECOND;
|
||||
auto elapsedUsecs = usecTimestampNow() - startedWaiting;
|
||||
if (elapsedUsecs > MAX_SCRIPT_EVALUATION_TIME) {
|
||||
qCDebug(scriptengine) <<
|
||||
"Script " << scriptName << " has been running too long [" << elapsedUsecs << " usecs] quitting.";
|
||||
abortEvaluation(); // to allow the thread to quit
|
||||
workerThread->quit();
|
||||
break;
|
||||
} else if (elapsedUsecs > MAX_SCRIPT_EVALUATION_TIME) {
|
||||
qCDebug(scriptengine) << "Script " << scriptName << " has been running too long [" << elapsedUsecs << " usecs] aborting evaluation.";
|
||||
QMetaObject::invokeMethod(this, "abortEvaluation");
|
||||
}
|
||||
|
||||
// Avoid a pure busy wait
|
||||
QThread::yieldCurrentThread();
|
||||
}
|
||||
|
||||
workerThread->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
(function() {
|
||||
|
||||
var version = 12;
|
||||
var version = 13;
|
||||
|
||||
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
|
||||
var button;
|
||||
|
@ -47,7 +47,7 @@
|
|||
var buttonPadding = 10;
|
||||
var offset = 0;
|
||||
var buttonPositionX = (offset + 1) * (buttonWidth + buttonPadding) + (windowDimensions.x / 2) - (buttonWidth * 3 + buttonPadding * 2.5);
|
||||
var buttonPositionY = (windowDimensions.y - buttonHeight) - 50;
|
||||
var buttonPositionY = (windowDimensions.y - buttonHeight) - 150;
|
||||
button = Overlays.addOverlay("image", {
|
||||
x: buttonPositionX,
|
||||
y: buttonPositionY,
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
(function() {
|
||||
|
||||
var version = 12;
|
||||
var version = 13;
|
||||
|
||||
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
|
||||
var button;
|
||||
|
@ -53,7 +53,7 @@
|
|||
var buttonPadding = 10;
|
||||
var offset = 3;
|
||||
var buttonPositionX = (offset + 1) * (buttonWidth + buttonPadding) + (windowDimensions.x / 2) - (buttonWidth * 3 + buttonPadding * 2.5);
|
||||
var buttonPositionY = (windowDimensions.y - buttonHeight) - 50;
|
||||
var buttonPositionY = (windowDimensions.y - buttonHeight) - 150;
|
||||
button = Overlays.addOverlay("image", {
|
||||
x: buttonPositionX,
|
||||
y: buttonPositionY,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
(function() {
|
||||
|
||||
var version = 12;
|
||||
var version = 13;
|
||||
|
||||
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
|
||||
var button;
|
||||
|
@ -47,7 +47,7 @@
|
|||
var buttonPadding = 10;
|
||||
var offset = 1;
|
||||
var buttonPositionX = (offset + 1) * (buttonWidth + buttonPadding) + (windowDimensions.x / 2) - (buttonWidth * 3 + buttonPadding * 2.5);
|
||||
var buttonPositionY = (windowDimensions.y - buttonHeight) - 50;
|
||||
var buttonPositionY = (windowDimensions.y - buttonHeight) - 150;
|
||||
button = Overlays.addOverlay("image", {
|
||||
x: buttonPositionX,
|
||||
y: buttonPositionY,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
//
|
||||
(function() {
|
||||
|
||||
var version = 12;
|
||||
var version = 13;
|
||||
|
||||
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
|
||||
var button;
|
||||
|
@ -26,9 +26,9 @@
|
|||
z: 3000
|
||||
},
|
||||
target: {
|
||||
x: 3276.6,
|
||||
y: 13703.3,
|
||||
z: 4405.6
|
||||
x: 13500,
|
||||
y: 3000,
|
||||
z: 3000
|
||||
},
|
||||
preload: function(entityId) {
|
||||
print('CELL PRELOAD RIBOSOME 1')
|
||||
|
@ -46,7 +46,7 @@
|
|||
var buttonPadding = 10;
|
||||
var offset = 2;
|
||||
var buttonPositionX = (offset + 1) * (buttonWidth + buttonPadding) + (windowDimensions.x / 2) - (buttonWidth * 3 + buttonPadding * 2.5);
|
||||
var buttonPositionY = (windowDimensions.y - buttonHeight) - 50;
|
||||
var buttonPositionY = (windowDimensions.y - buttonHeight) - 150;
|
||||
button = Overlays.addOverlay("image", {
|
||||
x: buttonPositionX,
|
||||
y: buttonPositionY,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
var version = 1217;
|
||||
var version = 1219;
|
||||
|
||||
var WORLD_OFFSET = {
|
||||
x: 0,
|
||||
|
|
Loading…
Reference in a new issue