Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 3, 2006, 12:19:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/collision_reaction/collision_handle.cc

    r9406 r9869  
    3030
    3131
    32 
     32ObjectListDefinition(CollisionHandle);
    3333
    3434/**
     
    3838CollisionHandle::CollisionHandle (WorldEntity* owner, CREngine::CRType type)
    3939{
    40   this->setClassID(CL_COLLISION_HANDLE, "CollisionHandle");
     40  this->registerObject(this, CollisionHandle::_objectList);
    4141
    4242  this->owner = owner;
     
    9494 *  @param classID the classid to look for
    9595 */
    96 void CollisionHandle::addTarget(long target)
     96void CollisionHandle::addTarget(const ClassID& target)
    9797{
    9898  // make sure there is no dublicate
    99   std::vector<long>::iterator it = this->targetList.begin();
     99  std::vector<ClassID>::iterator it = this->targetList.begin();
    100100  for( ; it < this->targetList.end(); it++)
    101101    if( (*it) == target)
    102102      return;
    103103
     104
    104105  // add element
    105    PRINTF(5)("addTarget: %i \n", target);
    106 
    107    this->targetList.push_back(target);
     106  this->targetList.push_back(target);
     107   PRINTF(5)("addTarget: %i \n", target.id());
    108108}
    109109
     
    227227bool CollisionHandle::filterCollisionEvent(CollisionEvent* collisionEvent)
    228228{
    229   std::vector<long>::iterator it = this->targetList.begin();
     229  std::vector<ClassID>::iterator it = this->targetList.begin();
    230230  for(; it < this->targetList.end(); it++)
    231231  {
     
    253253
    254254    if( collisionEvent->getEntityA() == this->owner) {
    255       if( collisionEvent->getEntityB()->isA((ClassID)(*it))) {
     255      if( collisionEvent->getEntityB()->isA((*it))) {
    256256        PRINTF(5)("I am: %s colliding with: %s is a %i filter ok\n", owner->getClassCName(),
    257                   collisionEvent->getEntityB()->getClassCName(), *it);
     257        collisionEvent->getEntityB()->getClassCName(), (*it).id());
    258258        return true; }
    259259    }
    260260    else {
    261       if( collisionEvent->getEntityA()->isA((ClassID)(*it))) {
     261      if( collisionEvent->getEntityA()->isA((*it))) {
    262262        PRINTF(5)("I am: %s colliding with: %s is a %i filter ok\n", owner->getClassCName(),
    263                   collisionEvent->getEntityA()->getClassCName(), *it);
     263        collisionEvent->getEntityA()->getClassCName(), (*it).id());
    264264      return true; }
    265265    }
     
    276276bool CollisionHandle::filterCollision(Collision* collision)
    277277{
    278   std::vector<long>::iterator it = this->targetList.begin();
     278  std::vector<ClassID>::iterator it = this->targetList.begin();
    279279  for(; it < this->targetList.end(); it++)
    280280  {
     
    302302
    303303    if( collision->getEntityA() == this->owner) {
    304       if( collision->getEntityA()->isA((ClassID)(*it)))
     304      if( collision->getEntityA()->isA(*it))
    305305        return true; }
    306306      else {
    307         if( collision->getEntityB()->isA((ClassID)(*it)))
     307        if( collision->getEntityB()->isA(*it))
    308308          return true; }
    309309  }
Note: See TracChangeset for help on using the changeset viewer.