Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10011 in orxonox.OLD


Ignore:
Timestamp:
Dec 4, 2006, 5:16:13 PM (17 years ago)
Author:
patrick
Message:

collision detection is working again, completely

Location:
branches/coll_rect.merge/src/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/coll_rect.merge/src/lib/collision_detection/obb_tree_node.cc

    r10010 r10011  
    479479    return;
    480480
    481   if( !CoRe::CollisionTube::getInstance()->isReactive( *nodeA, *nodeB) )
    482     return;
     481#warning this should be done
     482//   if( !CoRe::CollisionTube::getInstance()->isReactive( *nodeA, *nodeB) )
     483//     return;
    483484
    484485//   float distanceMax = this->bvElement->radius + ((OBBTreeNode*)treeNode)->bvElement->radius;
     
    571572        (treeNode->nodeRight == NULL && treeNode->nodeLeft == NULL)) )
    572573    {
    573       PRINTF(0)("----------------------------------------------\n\n\n\n\n\n--------------------------------\n\n\n");
     574      //PRINTF(0)("----------------------------------------------\n\n\n\n\n\n--------------------------------\n\n\n");
    574575      CoRe::CollisionTube::getInstance()->registerCollisionEvent( nodeA, nodeB, (BoundingVolume*)this->bvElement, (BoundingVolume*)treeNode->bvElement);
    575576    }
  • branches/coll_rect.merge/src/lib/collision_reaction/collision.h

    r10010 r10011  
    8181    inline bool isEntityBCollide() const { return this->_entityBCollide; }
    8282    /** sets the flag if it reacts @param flag true if it should react on entityB*/
    83     inline void setEntityBCollide(bool flag) { this->_entityACollide = flag; }
     83    inline void setEntityBCollide(bool flag) { this->_entityBCollide = flag; }
    8484
    8585
  • branches/coll_rect.merge/src/lib/collision_reaction/cr_engine.cc

    r10010 r10011  
    164164          continue;
    165165
    166         assert((*ci)->getEntityA() != NULL && (*ci)->getEntityB() != NULL);
    167 
    168166//         PRINTF(0)("CR CHECK: collision between: %s, %s\n", (*ci)->getEntityA()->getClassName().c_str(), (*ci)->getEntityB()->getClassName().c_str());
    169167
    170168        // check if entity A or B is subscibed for this event
    171         if( (*ci)->getEntityA()->isReactive(*(*ci)->getEntityB(), (CREngine::ReactionType)i) ||
    172             (*ci)->getEntityB()->isReactive(*(*ci)->getEntityA(), (CREngine::ReactionType)i))
     169        bool aReact = (*ci)->getEntityA()->isReactive(*(*ci)->getEntityB(), (CREngine::ReactionType)i);
     170        bool bReact = (*ci)->getEntityB()->isReactive(*(*ci)->getEntityA(), (CREngine::ReactionType)i);
     171
     172        // store this information
     173        (*ci)->setEntityACollide(aReact);
     174        (*ci)->setEntityBCollide(bReact);
     175
     176        // and execute the reaction
     177        if(  aReact || bReact)
    173178        {
    174179          this->_reactionList[i]->reactToCollision(*ci);
    175           PRINTF(0)("executing reaction: %s, between %s - %s\n", this->_reactionList[i]->getClassName().c_str(), (*ci)->getEntityA()->getClassName().c_str(), (*ci)->getEntityB()->getClassName().c_str());
     180          //PRINTF(0)("executing reaction: %s, between %s - %s\n", this->_reactionList[i]->getClassName().c_str(), (*ci)->getEntityA()->getClassName().c_str(), (*ci)->getEntityB()->getClassName().c_str());
    176181        }
    177182      }
  • branches/coll_rect.merge/src/lib/collision_reaction/cr_object_damage.cc

    r10010 r10011  
    5555    float damage = 0.0f;
    5656
    57     PRINTF(4)("Dealing damage - Handling collision: %s vs %s\n",
     57    PRINTF(0)("Dealing damage - Handling collision: %s vs %s\n",
    5858              collision->getEntityA()->getClassCName(),
    5959              collision->getEntityB()->getClassCName());
     
    6464      damage = collision->getEntityB()->getDamage();
    6565      collision->getEntityA()->hit(damage, collision->getEntityB());
    66       PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityA()->getClassCName());
     66      PRINTF(0)("Dealing damage - %f damage to %s \n", damage, collision->getEntityA()->getClassCName());
    6767    }
    6868
     
    7171      damage = collision->getEntityA()->getDamage();
    7272      collision->getEntityB()->hit(damage, collision->getEntityA());
    73       PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityB()->getClassCName());
     73      PRINTF(0)("Dealing damage - %f damage to %s \n", damage, collision->getEntityB()->getClassCName());
    7474    }
    7575
Note: See TracChangeset for help on using the changeset viewer.