From b76103edb00c10b4879b40d261e3dd64f7585eda Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 16 Mar 2015 16:44:29 -0700 Subject: [PATCH] clean up debugging spew --- libraries/entities/src/EntitySimulation.h | 10 ++------- libraries/entities/src/ModelEntityItem.cpp | 1 + libraries/octree/src/Octree.h | 25 +++++----------------- libraries/physics/src/PhysicsEngine.cpp | 18 ---------------- 4 files changed, 8 insertions(+), 46 deletions(-) diff --git a/libraries/entities/src/EntitySimulation.h b/libraries/entities/src/EntitySimulation.h index 3f61438d76..1eb4fdc951 100644 --- a/libraries/entities/src/EntitySimulation.h +++ b/libraries/entities/src/EntitySimulation.h @@ -38,14 +38,8 @@ public: EntitySimulation() : _mutex(QMutex::Recursive), _entityTree(NULL), _nextExpiry(quint64(-1)) { } virtual ~EntitySimulation() { setEntityTree(NULL); } - void lock() { - qDebug() << "LOCKING SIMULATION" << QThread::currentThreadId(); - _mutex.lock(); - } - void unlock() { - qDebug() << "UNLOCKING SIMULATION" << QThread::currentThreadId(); - _mutex.unlock(); - } + void lock() { _mutex.lock(); } + void unlock() { _mutex.unlock(); } /// \param tree pointer to EntityTree which is stored internally void setEntityTree(EntityTree* tree); diff --git a/libraries/entities/src/ModelEntityItem.cpp b/libraries/entities/src/ModelEntityItem.cpp index cf2cd50640..1f72c2e93d 100644 --- a/libraries/entities/src/ModelEntityItem.cpp +++ b/libraries/entities/src/ModelEntityItem.cpp @@ -427,6 +427,7 @@ bool ModelEntityItem::isReadyToComputeShape() { } if (_collisionNetworkGeometry.isNull()) { + _collisionNetworkGeometry = DependencyManager::get()->getGeometry(_collisionModelURL, QUrl(), false); diff --git a/libraries/octree/src/Octree.h b/libraries/octree/src/Octree.h index 41c40001f9..e50d12918f 100644 --- a/libraries/octree/src/Octree.h +++ b/libraries/octree/src/Octree.h @@ -287,26 +287,11 @@ public: void setDirtyBit() { _isDirty = true; } // Octree does not currently handle its own locking, caller must use these to lock/unlock - void lockForRead() { - qDebug() << "READ LOCKING OCTREE" << QThread::currentThreadId(); - _lock.lockForRead(); - } - bool tryLockForRead() { - qDebug() << "TRY READ LOCKING OCTREE" << QThread::currentThreadId(); - return _lock.tryLockForRead(); - } - void lockForWrite() { - qDebug() << "WRITE LOCKING OCTREE" << QThread::currentThreadId(); - _lock.lockForWrite(); - } - bool tryLockForWrite() { - qDebug() << "TRY WRITE LOCKING OCTREE" << QThread::currentThreadId(); - return _lock.tryLockForWrite(); - } - void unlock() { - qDebug() << "UNLOCKING OCTREE" << QThread::currentThreadId(); - _lock.unlock(); - } + void lockForRead() { _lock.lockForRead(); } + bool tryLockForRead() { return _lock.tryLockForRead(); } + void lockForWrite() { _lock.lockForWrite(); } + bool tryLockForWrite() { return _lock.tryLockForWrite(); } + void unlock() { _lock.unlock(); } // output hints from the encode process typedef enum { Lock, diff --git a/libraries/physics/src/PhysicsEngine.cpp b/libraries/physics/src/PhysicsEngine.cpp index c975d4faef..d5dfe849de 100644 --- a/libraries/physics/src/PhysicsEngine.cpp +++ b/libraries/physics/src/PhysicsEngine.cpp @@ -283,7 +283,6 @@ void PhysicsEngine::stepSimulation() { // expect the engine to have an avatar (and hence: a character controller) assert(_avatarData); - qDebug() << "lock0"; lock(); // NOTE: the grand order of operations is: @@ -315,9 +314,7 @@ void PhysicsEngine::stepSimulation() { int numSubsteps = _dynamicsWorld->stepSimulation(timeStep, MAX_NUM_SUBSTEPS, PHYSICS_ENGINE_FIXED_SUBSTEP); _numSubsteps += (uint32_t)numSubsteps; stepNonPhysicalKinematics(usecTimestampNow()); - qDebug() << "unlock0"; unlock(); - qDebug() << "unlock0.1"; if (numSubsteps > 0) { // This is step (3) which is done outside of stepSimulation() so we can lock _entityTree. @@ -330,43 +327,28 @@ void PhysicsEngine::stepSimulation() { // TODO: untangle these lock sequences. _entityTree->lockForWrite(); - qDebug() << "lock1"; lock(); - qDebug() << "lock1.1"; _dynamicsWorld->synchronizeMotionStates(); - qDebug() << "lock1.2"; _avatarData->lockForRead(); - qDebug() << "lock1.3"; bool avatarHasPhysicsEnabled = _avatarData->isPhysicsEnabled(); - qDebug() << "lock1.4"; _avatarData->unlock(); - qDebug() << "lock1.5"; if (avatarHasPhysicsEnabled) { const btTransform& avatarTransform = _avatarGhostObject->getWorldTransform(); glm::quat rotation = bulletToGLM(avatarTransform.getRotation()); glm::vec3 offset = rotation * _avatarShapeLocalOffset; - - qDebug() << "a"; - _avatarData->lockForWrite(); _avatarData->setOrientation(rotation); _avatarData->setPosition(bulletToGLM(avatarTransform.getOrigin()) - offset); _avatarData->unlock(); } - qDebug() << "unlock1"; unlock(); - qDebug() << "unlock1.1"; _avatarData->unlock(); - qDebug() << "unlock1.2"; _entityTree->unlock(); - qDebug() << "unlock1.3"; computeCollisionEvents(); } - - qDebug() << "end"; } void PhysicsEngine::stepNonPhysicalKinematics(const quint64& now) {