mirror of
https://github.com/JulianGro/overte.git
synced 2025-05-31 01:55:08 +02:00
experimenting
This commit is contained in:
parent
69ee33a392
commit
cd3ee39fcc
2 changed files with 4 additions and 9 deletions
|
@ -71,9 +71,11 @@ void setSimId(EntityItemProperties& propertiesWithSimID, EntityItem* entity) {
|
||||||
propertiesWithSimID.containsPositionChange()) {
|
propertiesWithSimID.containsPositionChange()) {
|
||||||
propertiesWithSimID.setSimulatorID(myNodeID);
|
propertiesWithSimID.setSimulatorID(myNodeID);
|
||||||
entity->setSimulatorID(myNodeID);
|
entity->setSimulatorID(myNodeID);
|
||||||
|
qDebug() << "script claiming ownership";
|
||||||
} else if (entity->getSimulatorID() == myNodeID) {
|
} else if (entity->getSimulatorID() == myNodeID) {
|
||||||
propertiesWithSimID.setSimulatorID(QUuid()); // give up simulation ownership
|
propertiesWithSimID.setSimulatorID(QUuid()); // give up simulation ownership
|
||||||
entity->setSimulatorID(QUuid());
|
entity->setSimulatorID(QUuid());
|
||||||
|
qDebug() << "script releasing ownership";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -399,15 +399,6 @@ void PhysicsEngine::computeCollisionEvents() {
|
||||||
// the manifold has up to 4 distinct points, but only extract info from the first
|
// 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);
|
_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
|
// collisions cause infections spread of simulation-ownership. we also attempt to take
|
||||||
// ownership of anything that collides with our avatar.
|
// ownership of anything that collides with our avatar.
|
||||||
if (entityA && entityB &&
|
if (entityA && entityB &&
|
||||||
|
@ -417,11 +408,13 @@ void PhysicsEngine::computeCollisionEvents() {
|
||||||
entityA->getShouldClaimSimulationOwnership() ||
|
entityA->getShouldClaimSimulationOwnership() ||
|
||||||
objectA == characterCollisionObject) {
|
objectA == characterCollisionObject) {
|
||||||
entityB->setShouldClaimSimulationOwnership(true);
|
entityB->setShouldClaimSimulationOwnership(true);
|
||||||
|
qDebug() << "collision claiming ownership";
|
||||||
}
|
}
|
||||||
if (entityB->getSimulatorID() == myNodeID ||
|
if (entityB->getSimulatorID() == myNodeID ||
|
||||||
entityB->getShouldClaimSimulationOwnership() ||
|
entityB->getShouldClaimSimulationOwnership() ||
|
||||||
objectB == characterCollisionObject) {
|
objectB == characterCollisionObject) {
|
||||||
entityA->setShouldClaimSimulationOwnership(true);
|
entityA->setShouldClaimSimulationOwnership(true);
|
||||||
|
qDebug() << "collision claiming ownership";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue