From 6840daa0b5dbd697bea72328ddff2896bfc5e9a8 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 21 Jan 2015 11:55:28 -0800 Subject: [PATCH] removing tabs from formatting --- libraries/physics/src/PhysicsEngine.cpp | 42 ++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/libraries/physics/src/PhysicsEngine.cpp b/libraries/physics/src/PhysicsEngine.cpp index a8b168681e..dea321be22 100644 --- a/libraries/physics/src/PhysicsEngine.cpp +++ b/libraries/physics/src/PhysicsEngine.cpp @@ -159,14 +159,14 @@ void PhysicsEngine::relayIncomingChangesToSimulation() { void PhysicsEngine::removeContacts(ObjectMotionState* motionState) { // trigger events for new/existing/old contacts - ContactMap::iterator contactItr = _contactMap.begin(); - while (contactItr != _contactMap.end()) { + ContactMap::iterator contactItr = _contactMap.begin(); + while (contactItr != _contactMap.end()) { if (contactItr->first._a == motionState || contactItr->first._b == motionState) { - ContactMap::iterator iterToDelete = contactItr; - ++contactItr; - _contactMap.erase(iterToDelete); + ContactMap::iterator iterToDelete = contactItr; + ++contactItr; + _contactMap.erase(iterToDelete); } else { - ++contactItr; + ++contactItr; } } } @@ -251,26 +251,26 @@ void PhysicsEngine::stepSimulation() { void PhysicsEngine::computeCollisionEvents() { // update all contacts int numManifolds = _collisionDispatcher->getNumManifolds(); - for (int i = 0; i < numManifolds; ++i) { - btPersistentManifold* contactManifold = _collisionDispatcher->getManifoldByIndexInternal(i); + for (int i = 0; i < numManifolds; ++i) { + btPersistentManifold* contactManifold = _collisionDispatcher->getManifoldByIndexInternal(i); if (contactManifold->getNumContacts() > 0) { - const btCollisionObject* objectA = static_cast(contactManifold->getBody0()); - const btCollisionObject* objectB = static_cast(contactManifold->getBody1()); + const btCollisionObject* objectA = static_cast(contactManifold->getBody0()); + const btCollisionObject* objectB = static_cast(contactManifold->getBody1()); void* a = objectA->getUserPointer(); void* b = objectB->getUserPointer(); if (a || b) { // the manifold has up to 4 distinct points, but only extract info from the first - _contactMap[ContactKey(a, b)].update(_numSubsteps, contactManifold->getContactPoint(0), _originOffset); + _contactMap[ContactKey(a, b)].update(_numSubsteps, contactManifold->getContactPoint(0), _originOffset); } } } - + // scan known contacts and trigger events - ContactMap::iterator contactItr = _contactMap.begin(); - while (contactItr != _contactMap.end()) { - ObjectMotionState* A = static_cast(contactItr->first._a); - ObjectMotionState* B = static_cast(contactItr->first._b); + ContactMap::iterator contactItr = _contactMap.begin(); + while (contactItr != _contactMap.end()) { + ObjectMotionState* A = static_cast(contactItr->first._a); + ObjectMotionState* B = static_cast(contactItr->first._b); // TODO: make triggering these events clean and efficient. The code at this context shouldn't // have to figure out what kind of object (entity, avatar, etc) these are in order to properly @@ -289,13 +289,13 @@ void PhysicsEngine::computeCollisionEvents() { } // TODO: enable scripts to filter based on contact event type - ContactEventType type = contactItr->second.computeType(_numSubsteps); + ContactEventType type = contactItr->second.computeType(_numSubsteps); if (type == CONTACT_EVENT_TYPE_END) { - ContactMap::iterator iterToDelete = contactItr; - ++contactItr; - _contactMap.erase(iterToDelete); + ContactMap::iterator iterToDelete = contactItr; + ++contactItr; + _contactMap.erase(iterToDelete); } else { - ++contactItr; + ++contactItr; } } }