mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 21:43:03 +02:00
small cleanup and some debugging prints
This commit is contained in:
parent
fbff3627dc
commit
88f289f3c1
1 changed files with 5 additions and 9 deletions
|
@ -394,25 +394,21 @@ void PhysicsEngine::computeCollisionEvents() {
|
||||||
void* b = objectB->getUserPointer();
|
void* b = objectB->getUserPointer();
|
||||||
if (a || b) {
|
if (a || b) {
|
||||||
// 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
|
||||||
const ContactKey& contactKey = ContactKey(a, b);
|
_contactMap[ContactKey(a, b)].update(_numContactFrames, contactManifold->getContactPoint(0), _originOffset);
|
||||||
ContactInfo& contactInfo = _contactMap[contactKey];
|
|
||||||
contactInfo.update(_numContactFrames, contactManifold->getContactPoint(0), _originOffset);
|
|
||||||
|
|
||||||
// if our character capsule is colliding with something dynamic, claim simulation ownership.
|
// if our character capsule is colliding with something dynamic, claim simulation ownership.
|
||||||
// do this by setting the entity's simulator-id to NULL, thereby causing EntityMotionState::sendUpdate
|
// do this by setting the entity's simulator-id to NULL, thereby causing EntityMotionState::sendUpdate
|
||||||
// to set ownership to us.
|
// to set ownership to us.
|
||||||
if (objectA == characterCollisionObject && !objectB->isStaticOrKinematicObject() && b) {
|
if (objectA == characterCollisionObject && !objectB->isStaticOrKinematicObject() && b) {
|
||||||
ObjectMotionState* B = static_cast<ObjectMotionState*>(b);
|
EntityItem* entityB = static_cast<EntityMotionState*>(b)->getEntity();
|
||||||
EntityItem* entityB = static_cast<EntityMotionState*>(B)->getEntity();
|
if (!entityB->getSimulatorID().isNull() && entityB->getSimulatorID() != myNodeID) {
|
||||||
if (entityB->getSimulatorID() != myNodeID) {
|
|
||||||
qDebug() << "CLAIMING B";
|
qDebug() << "CLAIMING B";
|
||||||
entityB->setSimulatorID(NULL);
|
entityB->setSimulatorID(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (objectB == characterCollisionObject && !objectA->isStaticOrKinematicObject() && a) {
|
if (objectB == characterCollisionObject && !objectA->isStaticOrKinematicObject() && a) {
|
||||||
ObjectMotionState* A = static_cast<ObjectMotionState*>(a);
|
EntityItem* entityA = static_cast<EntityMotionState*>(a)->getEntity();
|
||||||
EntityItem* entityA = static_cast<EntityMotionState*>(A)->getEntity();
|
if (!entityA->getSimulatorID().isNull() && entityA->getSimulatorID() != myNodeID) {
|
||||||
if (entityA->getSimulatorID() != myNodeID) {
|
|
||||||
qDebug() << "CLAIMING A";
|
qDebug() << "CLAIMING A";
|
||||||
entityA->setSimulatorID(NULL);
|
entityA->setSimulatorID(NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue