From cd3ee39fcc3e46e5b21e5fb262dfdf17e4f7683c Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 22 Apr 2015 13:42:04 -0700 Subject: [PATCH] experimenting --- libraries/entities/src/EntityScriptingInterface.cpp | 2 ++ libraries/physics/src/PhysicsEngine.cpp | 11 ++--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 53335beda0..8d73fd8e95 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -71,9 +71,11 @@ void setSimId(EntityItemProperties& propertiesWithSimID, EntityItem* entity) { propertiesWithSimID.containsPositionChange()) { propertiesWithSimID.setSimulatorID(myNodeID); entity->setSimulatorID(myNodeID); + qDebug() << "script claiming ownership"; } else if (entity->getSimulatorID() == myNodeID) { propertiesWithSimID.setSimulatorID(QUuid()); // give up simulation ownership entity->setSimulatorID(QUuid()); + qDebug() << "script releasing ownership"; } } diff --git a/libraries/physics/src/PhysicsEngine.cpp b/libraries/physics/src/PhysicsEngine.cpp index 3cc8017722..e4e9c547df 100644 --- a/libraries/physics/src/PhysicsEngine.cpp +++ b/libraries/physics/src/PhysicsEngine.cpp @@ -399,15 +399,6 @@ void PhysicsEngine::computeCollisionEvents() { // the manifold has up to 4 distinct points, but only extract info from the first _contactMap[ContactKey(a, b)].update(_numContactFrames, contactManifold->getContactPoint(0), _originOffset); - // if our character capsule is colliding with something dynamic, claim simulation ownership. - // see EntityMotionState::sendUpdate - // if (objectA == characterCollisionObject && !objectB->isStaticOrKinematicObject() && b) { - // entityB->setShouldClaimSimulationOwnership(true); - // } - // if (objectB == characterCollisionObject && !objectA->isStaticOrKinematicObject() && a) { - // entityA->setShouldClaimSimulationOwnership(true); - // } - // collisions cause infections spread of simulation-ownership. we also attempt to take // ownership of anything that collides with our avatar. if (entityA && entityB && @@ -417,11 +408,13 @@ void PhysicsEngine::computeCollisionEvents() { entityA->getShouldClaimSimulationOwnership() || objectA == characterCollisionObject) { entityB->setShouldClaimSimulationOwnership(true); + qDebug() << "collision claiming ownership"; } if (entityB->getSimulatorID() == myNodeID || entityB->getShouldClaimSimulationOwnership() || objectB == characterCollisionObject) { entityA->setShouldClaimSimulationOwnership(true); + qDebug() << "collision claiming ownership"; } } }