Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7946 in orxonox.OLD for branches/cr/src/lib


Ignore:
Timestamp:
May 29, 2006, 1:04:39 AM (19 years ago)
Author:
patrick
Message:

cr: more cr cleanup

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

Legend:

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

    r7945 r7946  
    4343{
    4444  // delete what has to be deleted here
     45}
     46
     47/**
     48 * restores the CollisionHandle to its initial state
     49 */
     50void CollisionHandle::reset()
     51{
     52  this->flushCollisions();
    4553}
    4654
  • branches/cr/src/lib/collision_reaction/collision_handle.h

    r7945 r7946  
    2727    virtual ~CollisionHandle();
    2828
     29    void reset();
    2930
    3031    void addTarget(long classID);
    31 
    3232    void registerCollision(Collision* collision);
    3333
  • branches/cr/src/lib/collision_reaction/cr_engine.cc

    r7945 r7946  
    6464
    6565
     66/**
     67 * flushes the CollisionHandles and restores the CREngine to the initial state
     68 */
    6669void CREngine::reset()
    6770{
     
    6972  std::vector<CollisionHandle*>::iterator it;
    7073  for( it = this->collisionHandles.begin(); it != this->collisionHandles.end(); it++)
     74  {
     75    (*it)->reset();
    7176    delete *it;
     77  }
    7278  this->collisionHandles.clear();
    7379}
     
    7884 *  @param owner: the WE to subscribe
    7985 *  @param type: the type of collision reaction to perform
     86 *  @return the newly created CollisionHandle
    8087 */
    8188CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, CRType type)
     
    8693
    8794
    88 bool CREngine::unsubscribeReaction(WorldEntity* worldEntity)
    89 {}
    90 
    91 
     95/**
     96 * unsubscribe reaction from the reaction list
     97 *  @param collisionHandle the CollisionHandle to remove
     98 *  @param returns true if worked collrectly
     99 */
    92100bool CREngine::unsubscribeReaction(CollisionHandle* collisionHandle)
    93 {}
     101{
     102  std::vector<CollisionHandle*>::iterator it;
     103  for( it = this->collisionHandles.begin(); it != this->collisionHandles.end(); it++)
     104  {
     105    if( *it == collisionHandle)
     106    {
     107      this->collisionHandles.erase(it);
     108      delete collisionHandle;
     109      return true;
     110    }
     111  }
     112  return false;
     113}
    94114
    95115
  • branches/cr/src/lib/collision_reaction/cr_engine.h

    r7945 r7946  
    4646  CollisionHandle* subscribeReaction(WorldEntity* worldEntity, CRType type);
    4747
    48   bool unsubscribeReaction(WorldEntity* worldEntity);
    4948  bool unsubscribeReaction(CollisionHandle* collisionHandle);
    5049
Note: See TracChangeset for help on using the changeset viewer.