Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7966 in orxonox.OLD for branches/cr


Ignore:
Timestamp:
May 30, 2006, 1:10:11 AM (19 years ago)
Author:
patrick
Message:

cr: collision registration processes

Location:
branches/cr/src/lib/collision_reaction
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/cr/src/lib/collision_reaction/collision_handle.cc

    r7964 r7966  
    7373
    7474/**
     75 * registers a new Collision Object
     76 */
     77Collision* CollisionHandle::registerCollision(WorldEntity* entityA, WorldEntity* entityB)
     78{
     79  // get the new collision object
     80  Collision* c = CREngine::getInstance()->popCollisionObject();
     81
     82  c->collide(collisionEvent->getEntityA(), collisionEvent->getEntityB());
     83  this->collisionList.push_back(c);
     84}
     85
     86
     87/**
    7588 * this is the function to be called on a collision event for this handle
    7689 *  @param collision the collision objects containing all collision informations
     
    8194  if( this->collisionList.empty())
    8295  {
    83     Collision* c = CREngine::getInstance()->popCollisionObject();
    84     c->collide(collisionEvent->getEntityA(), collisionEvent->getEntityB());
    85     this->collisionList.push_back(c);
     96    return;
    8697  }
     98
    8799  if( ((this->collisionList.back())->getEntityA() == collisionEvent->getEntityA()) &&
    88100        ((this->collisionList.back())->getEntityB() == collisionEvent->getEntityB()))
     
    90102    (this->collisionList.back())->registerCollisionEvent(collisionEvent);
    91103  }
     104}
    92105
    93   //this->collisionList.push_back(collisionEvent);
    94 }
    95106
    96107/**
  • branches/cr/src/lib/collision_reaction/collision_handle.h

    r7964 r7966  
    2929
    3030    void addTarget(long classID);
     31    Collision registerCollision(WorldEntity* entityA, WorldEntity* entityB);
    3132    void registerCollisionEvent(CollisionEvent* collisionEvent);
    3233    /** @returns true if regiestered some new collision events in this tick frame */
  • branches/cr/src/lib/collision_reaction/cr_engine.cc

    r7964 r7966  
    133133
    134134
     135/**
     136 * processes the collisions by calling the EventHandlers
     137 */
    135138void CREngine::handleCollisions()
    136139{
     
    143146    }
    144147  }
     148  this->flushCollisions();
    145149}
    146150
     151/**
     152 * flushes all the collision lists and puts them to their initial state
     153 */
     154void CREngeine::flushCollisions()
     155{
     156
     157}
    147158
    148159
  • branches/cr/src/lib/collision_reaction/cr_engine.h

    r7964 r7966  
    7373  void init();
    7474
     75  void flushCollisions();
     76
    7577
    7678private:
Note: See TracChangeset for help on using the changeset viewer.