Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 19, 2006, 3:54:49 PM (18 years ago)
Author:
patrick
Message:

interface adjustements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/coll_rect/src/lib/collision_reaction/cr_engine.cc

    r9893 r9895  
    2020#include "collision.h"
    2121#include "collision_event.h"
    22 #include "collision_handle.h"
     22#include "collision_filter.h"
    2323#include "cr_defs.h"
    2424
     
    122122  void CREngine::reset()
    123123  {
    124     // first clear all CollisionHandles
    125     std::vector<CollisionHandle*>::iterator it = this->collisionHandles.begin();
    126     for(; it < this->collisionHandles.end(); it++)
    127     {
    128       (*it)->reset();
    129       delete *it;
    130     }
    131 
    132     this->collisionHandles.clear();
     124//     // first clear all CollisionHandles
     125//     std::vector<CollisionHandle*>::iterator it = this->collisionHandles.begin();
     126//     for(; it < this->collisionHandles.end(); it++)
     127//     {
     128//       (*it)->reset();
     129//       delete *it;
     130//     }
     131//
     132//     this->collisionHandles.clear();
    133133  }
    134134
     
    140140   *  @return the newly created CollisionHandle
    141141   */
    142   CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, ReactionType type)
    143   {
    144     CollisionHandle* ch = new CollisionHandle(owner, type);
    145     this->collisionHandles.push_back(ch);
    146 
    147     return ch;
    148   }
     142//   CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, ReactionType type)
     143//   {
     144//     CollisionHandle* ch = new CollisionHandle(owner, type);
     145//     this->collisionHandles.push_back(ch);
     146//
     147//     return ch;
     148//   }
    149149
    150150
     
    154154   *  @param returns true if worked collrectly
    155155   */
    156   bool CREngine::unsubscribeReaction(CollisionHandle* collisionHandle)
    157   {
    158     std::vector<CollisionHandle*>::iterator it;
    159     for( it = this->collisionHandles.begin(); it != this->collisionHandles.end(); it++)
    160     {
    161       if( *it == collisionHandle)
    162       {
    163         this->collisionHandles.erase(it);
    164         delete collisionHandle;
    165         return true;
    166       }
    167     }
    168     return false;
    169   }
     156//   bool CREngine::unsubscribeReaction(CollisionHandle* collisionHandle)
     157//   {
     158//     std::vector<CollisionHandle*>::iterator it;
     159//     for( it = this->collisionHandles.begin(); it != this->collisionHandles.end(); it++)
     160//     {
     161//       if( *it == collisionHandle)
     162//       {
     163//         this->collisionHandles.erase(it);
     164//         delete collisionHandle;
     165//         return true;
     166//       }
     167//     }
     168//     return false;
     169//   }
    170170
    171171
     
    175175  void CREngine::handleCollisions()
    176176  {
    177     std::vector<CollisionHandle*>::iterator it;
    178     for( it = this->collisionHandles.begin(); it != this->collisionHandles.end(); it++)
    179     {
    180       if( !(*it)->isDispatched() || (*it)->isContinuousPoll())  //does it have any collisions to report at all
    181       {
    182         (*it)->handleCollisions();
    183       }
    184     }
    185     this->flushCollisions();
     177//     std::vector<CollisionHandle*>::iterator it;
     178//     for( it = this->collisionHandles.begin(); it != this->collisionHandles.end(); it++)
     179//     {
     180//       if( !(*it)->isDispatched() || (*it)->isContinuousPoll())  //does it have any collisions to report at all
     181//       {
     182//         (*it)->handleCollisions();
     183//       }
     184//     }
     185//     this->flushCollisions();
    186186  }
    187187
Note: See TracChangeset for help on using the changeset viewer.