Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8264 in orxonox.OLD for branches/bsp_model/src/lib


Ignore:
Timestamp:
Jun 8, 2006, 4:19:39 PM (18 years ago)
Author:
patrick
Message:

bsp: fixed a bug in the cr engine. now the checks are performed correctly

Location:
branches/bsp_model/src/lib
Files:
2 edited

Legend:

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

    r8256 r8264  
    221221bool CollisionHandle::filterCollisionEvent(CollisionEvent* collisionEvent)
    222222{
    223   if( this->type == CREngine::CR_PHYSICS_GROUND_WALK)
    224   {
    225 
    226     vector<long>::iterator it = this->targetList.begin();
    227     for(; it < this->targetList.end(); it++)
    228     {
    229       PRINTF(0)("filtering: %i vs EntityA %i, EntityB %i \n", *it, collisionEvent->getEntityA()->getClassID(), collisionEvent->getEntityB()->getClassID());
    230 
    231     }
    232   }
    233 
    234223  vector<long>::iterator it = this->targetList.begin();
    235224  for(; it < this->targetList.end(); it++)
    236225  {
    237226    if( collisionEvent->getEntityA() == this->owner) {
     227      if( collisionEvent->getEntityB()->isA((ClassID)(*it)))
     228        return true; }
     229    else {
    238230      if( collisionEvent->getEntityA()->isA((ClassID)(*it)))
    239231        return true; }
    240     else {
    241       if( collisionEvent->getEntityB()->isA((ClassID)(*it)))
    242         return true; }
    243   }
     232  }
     233
    244234
    245235  return false;
  • branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc

    r8234 r8264  
    917917
    918918    */
    919    
     919
    920920    float height = 10;
    921        
    922        
     921
     922
    923923    this->checkCollisionRayN(this->root,0.0f,1.0f, &position, &dest );
    924924    if(this->outputFraction == 1.0f) out = dest;
     
    939939
    940940    }
    941    
    942    
     941
     942
    943943
    944944    // Return the normal here: Normal's stored in this->collPlane;
     
    946946    if(collision) {
    947947      PRINTF(0)("We got a collision!! Are you sure: outputFraction = %f\n", this->outputFraction);
    948       worldEntity->registerCollision(worldEntity, this->parent, Vector(this->collPlane->x, this->collPlane->y, this->collPlane->z), out);
     948      worldEntity->registerCollision(this->parent, worldEntity, Vector(this->collPlane->x, this->collPlane->y, this->collPlane->z), out);
    949949    }
    950950      //worldEntity->collidesWithGround(out,out1,out2);
Note: See TracChangeset for help on using the changeset viewer.