diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index a5d87dee99..5a141af581 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -72,8 +72,7 @@ EntityItem::EntityItem(const EntityItemID& entityItemID) : _lastUpdated = now; } -EntityItem::EntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) : - EntityItem(entityItemID) +EntityItem::EntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) : EntityItem(entityItemID) { setProperties(properties); } diff --git a/libraries/physics/src/EntityMotionState.cpp b/libraries/physics/src/EntityMotionState.cpp index 2a779d019a..e77271710f 100644 --- a/libraries/physics/src/EntityMotionState.cpp +++ b/libraries/physics/src/EntityMotionState.cpp @@ -200,7 +200,6 @@ bool EntityMotionState::shouldSendUpdate(uint32_t simulationFrame) { const QUuid& myNodeID = nodeList->getSessionUUID(); const QUuid& simulatorID = _entity->getSimulatorID(); - // if (!simulatorID.isNull() && simulatorID != myNodeID) { if (simulatorID != myNodeID) { // some other Node owns the simulating of this, so don't broadcast the results of local simulation. return false; @@ -280,24 +279,13 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, uint32_ properties.setAngularVelocity(_sentAngularVelocity); } - auto nodeList = DependencyManager::get(); - QUuid myNodeID = nodeList->getSessionUUID(); - // QUuid simulatorID = _entity->getSimulatorID(); - if (_entity->getShouldClaimSimulationOwnership()) { + auto nodeList = DependencyManager::get(); + QUuid myNodeID = nodeList->getSessionUUID(); _entity->setSimulatorID(myNodeID); properties.setSimulatorID(myNodeID); _entity->setShouldClaimSimulationOwnership(false); } - // else if (simulatorID.isNull() && !(zeroSpeed && zeroSpin)) { - // // The object is moving and nobody thinks they own the motion. set this Node as the simulator - // _entity->setSimulatorID(myNodeID); - // properties.setSimulatorID(myNodeID); - // } else if (simulatorID == myNodeID && zeroSpeed && zeroSpin) { - // // we are the simulator and the object has stopped. give up "simulator" status - // _entity->setSimulatorID(QUuid()); - // properties.setSimulatorID(QUuid()); - // } // RELIABLE_SEND_HACK: count number of updates for entities at rest so we can stop sending them after some limit. if (_sentMoving) { diff --git a/libraries/physics/src/PhysicsEngine.cpp b/libraries/physics/src/PhysicsEngine.cpp index 8063f5cde7..ae76e1c785 100644 --- a/libraries/physics/src/PhysicsEngine.cpp +++ b/libraries/physics/src/PhysicsEngine.cpp @@ -401,29 +401,15 @@ void PhysicsEngine::computeCollisionEvents() { // collisions cause infections spread of simulation-ownership. we also attempt to take // ownership of anything that collides with our avatar. - if (entityA && entityB && - !objectA->isStaticOrKinematicObject() && - !objectB->isStaticOrKinematicObject()) { + if (entityA && entityB && !objectA->isStaticOrKinematicObject() && !objectB->isStaticOrKinematicObject()) { if (entityA->getSimulatorID() == myNodeID || entityA->getShouldClaimSimulationOwnership() || objectA == characterCollisionObject) { - - qDebug() << "collision claiming ownership 0" - << (entityA->getSimulatorID() == myNodeID) - << (entityA->getShouldClaimSimulationOwnership()) - << (objectA == characterCollisionObject) << myNodeID; - entityB->setShouldClaimSimulationOwnership(true); } if (entityB->getSimulatorID() == myNodeID || entityB->getShouldClaimSimulationOwnership() || objectB == characterCollisionObject) { - - qDebug() << "collision claiming ownership 1" - << (entityB->getSimulatorID() == myNodeID) - << (entityB->getShouldClaimSimulationOwnership()) - << (objectB == characterCollisionObject) << myNodeID; - entityA->setShouldClaimSimulationOwnership(true); } }