Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 14, 2006, 1:25:47 AM (18 years ago)
Author:
patrick
Message:

new interface to collision registers, more transparent. some more functionality

File:
1 edited

Legend:

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

    r9890 r9892  
    8989
    9090  /**
     91   * @returns an instance to a collision object. instead of creating new object this ones can be resycled
     92   */
     93  Collision* CREngine::popCollisionObject()
     94  {
     95    if( !this->collisionsUnused.empty())
     96    {
     97      this->collisionsUsed.push_back(this->collisionsUnused.back());
     98      this->collisionsUnused.pop_back();
     99      return this->collisionsUsed.back();
     100    }
     101    else return NULL;
     102  }
     103
     104  /**
     105   * @return an instanco of a CollisionEvent object. instead of creating a new object this ones can be used and resycled
     106   */
     107  CollisionEvent* CREngine::popCollisionEventObject()
     108  {
     109    if( !this->collisionEventsUnused.empty())
     110    {
     111      this->collisionEventsUsed.push_back(this->collisionEventsUnused.back());
     112      this->collisionEventsUnused.pop_back();
     113      return this->collisionEventsUsed.back();
     114    }
     115    else return NULL;
     116  }
     117
     118
     119  /**
    91120   * flushes the CollisionHandles and restores the CREngine to the initial state
    92121   */
     
    112141   *  @return the newly created CollisionHandle
    113142   */
    114   CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, CRType type)
     143  CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, ReactionType type)
    115144  {
    116145    CollisionHandle* ch = new CollisionHandle(owner, type);
Note: See TracChangeset for help on using the changeset viewer.