experimenting

This commit is contained in:
Seth Alves 2015-04-22 13:42:04 -07:00
parent 69ee33a392
commit cd3ee39fcc
2 changed files with 4 additions and 9 deletions

View file

@ -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";
}
}

View file

@ -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";
}
}
}