diff --git a/interface/src/ui/ToolWindow.cpp b/interface/src/ui/ToolWindow.cpp index 8774bffc36..5888b83f4a 100644 --- a/interface/src/ui/ToolWindow.cpp +++ b/interface/src/ui/ToolWindow.cpp @@ -22,7 +22,9 @@ ToolWindow::ToolWindow(QWidget* parent) : _hasShown(false), _lastGeometry() { +# ifndef Q_OS_LINUX setDockOptions(QMainWindow::ForceTabbedDocks); +# endif Application::getInstance()->installEventFilter(this); } @@ -53,6 +55,7 @@ bool ToolWindow::event(QEvent* event) { } bool ToolWindow::eventFilter(QObject* sender, QEvent* event) { +# ifndef Q_OS_LINUX switch (event->type()) { case QEvent::WindowStateChange: if (Application::getInstance()->getWindow()->isMinimized()) { @@ -77,7 +80,7 @@ bool ToolWindow::eventFilter(QObject* sender, QEvent* event) { default: break; } - +# endif return false; } diff --git a/libraries/entities/src/ModelEntityItem.cpp b/libraries/entities/src/ModelEntityItem.cpp index 0f9f9fd6fd..54fc8dfbe6 100644 --- a/libraries/entities/src/ModelEntityItem.cpp +++ b/libraries/entities/src/ModelEntityItem.cpp @@ -18,6 +18,7 @@ #include "EntityTreeElement.h" #include "ModelEntityItem.h" #include "GeometryCache.h" +#include "ResourceCache.h" const QString ModelEntityItem::DEFAULT_MODEL_URL = QString(""); const QString ModelEntityItem::DEFAULT_COLLISION_MODEL_URL = QString(""); @@ -417,21 +418,29 @@ QString ModelEntityItem::getAnimationSettings() const { void ModelEntityItem::getReadyToComputeShape() { qDebug() << "ModelEntityItem::getReadyToComputeShape for " << getID().toString(); - if (_collisionModelURL != "" && _collisionNetworkGeometry.isNull()) { - qDebug() << " yes"; - // QSharedPointer networkGeometry = - _collisionNetworkGeometry = DependencyManager::get()->getGeometry (_collisionModelURL, QUrl(), false); - - // XXX does this do an unneeded copy? - // FBXGeometry _collisionModel = networkGeometry->getFBXGeometry(); - FBXGeometry _collisionModel = _collisionNetworkGeometry->getFBXGeometry(); - - // connect(networkGeometry, loaded, this, collisionGeometryLoaded); - + if (_collisionModelURL != "") { + if (! _collisionNetworkGeometry.isNull()) { + qDebug() << " url is" << _collisionModelURL; + // QSharedPointer networkGeometry = + _collisionNetworkGeometry = + DependencyManager::get()->getGeometry (_collisionModelURL, QUrl(), false); + connect(_collisionNetworkGeometry.data(), SIGNAL(Resource::loaded()), this, SLOT(collisionGeometryLoaded())); + } + } else { emit entityShapeReady(getID()); } } +void ModelEntityItem::collisionGeometryLoaded() { + qDebug() << "ModelEntityItem::collisionGeometryLoaded for " << getID().toString(); + + // XXX does this do an unneeded copy? + // FBXGeometry _collisionModel = networkGeometry->getFBXGeometry(); + FBXGeometry _collisionModel = _collisionNetworkGeometry->getFBXGeometry(); + + emit entityShapeReady(getID()); +} + void ModelEntityItem::computeShapeInfo(ShapeInfo& info) { qDebug() << "ModelEntityItem::computeShapeInfo for " << getID().toString(); info.setParams(getShapeType(), 0.5f * getDimensions(), NULL, _collisionModelURL); diff --git a/libraries/entities/src/ModelEntityItem.h b/libraries/entities/src/ModelEntityItem.h index 4252bbd378..4ebe693034 100644 --- a/libraries/entities/src/ModelEntityItem.h +++ b/libraries/entities/src/ModelEntityItem.h @@ -20,6 +20,8 @@ class NetworkGeometry; class GeometryCache; class ModelEntityItem : public EntityItem { + Q_OBJECT + public: static EntityItem* factory(const EntityItemID& entityID, const EntityItemProperties& properties); @@ -134,6 +136,9 @@ public: static void cleanupLoadedAnimations(); void getReadyToComputeShape(); + +public slots: + void collisionGeometryLoaded(); protected: diff --git a/libraries/physics/src/PhysicsEngine.cpp b/libraries/physics/src/PhysicsEngine.cpp index d5d832874b..c14770b4f3 100644 --- a/libraries/physics/src/PhysicsEngine.cpp +++ b/libraries/physics/src/PhysicsEngine.cpp @@ -60,10 +60,7 @@ void PhysicsEngine::addEntityInternal(EntityItem* entity) { assert(entity); void* physicsInfo = entity->getPhysicsInfo(); if (!physicsInfo && !_busyComputingShape.contains(entity->getID())) { - ShapeInfo shapeInfo; - - qDebug() << "in addEntityInternal ID is" << entity->getID().toString(); - + // qDebug() << "in addEntityInternal ID is" << entity->getID().toString(); QPointer entityWptr(entity); _busyComputingShape[entity->getID()] = entityWptr; connect(entity, SIGNAL(entityShapeReady(QUuid)), this, SLOT(entityShapeReady(QUuid))); @@ -72,8 +69,7 @@ void PhysicsEngine::addEntityInternal(EntityItem* entity) { } void PhysicsEngine::entityShapeReady(QUuid entityId) { - - qDebug() << "PhysicsEngine::entityShapeReady for" << entityId.toString(); + // qDebug() << "PhysicsEngine::entityShapeReady for" << entityId.toString(); QPointer entityPtr = _busyComputingShape[entityId]; _busyComputingShape.remove(entityId);