Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9983 in orxonox.OLD for branches/coll_rect/src


Ignore:
Timestamp:
Dec 2, 2006, 4:11:40 PM (18 years ago)
Author:
patrick
Message:

collision object adjustements

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

Legend:

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

    r9980 r9983  
    4343  void Collision::flushCollisionEvents()
    4444  {
    45     this->entityA = NULL;
    46     this->entityB = NULL;
     45    this->_entityA = NULL;
     46    this->_entityB = NULL;
    4747
    48     this->entityACollide = false;
    49     this->entityBCollide = false;
    50 
    51     this->bDispatched = true;
     48    this->_entityACollide = false;
     49    this->_entityBCollide = false;
    5250
    5351    this->_collisionEvents.clear();
  • branches/coll_rect/src/lib/collision_reaction/collision.h

    r9939 r9983  
    4242    /* list stuff */
    4343  public:
    44     typedef std::vector<CollisionEvent*>                  collisionVector;  //!< the vector containing all collision events
    45     typedef std::vector<CollisionEvent*>::iterator        iterator;         //!< iterator definition
    46     typedef std::vector<CollisionEvent*>::const_iterator  const_iterator;   //!< constant iterator definition
     44    typedef std::vector<CollisionEvent*>                  CollisionVector;  //!< the vector containing all collision events
     45    typedef std::vector<CollisionEvent*>::iterator        Iterator;         //!< iterator definition
     46    typedef std::vector<CollisionEvent*>::const_iterator  ConstIterator;   //!< constant iterator definition
    4747
    4848    /** registers a @param event CollisionEvent to take place */
    4949    inline void registerCollisionEvent(CollisionEvent* event) { this->_collisionEvents.push_back(event); this->bDispatched = false;}
    50     /** @returns a vector of collision events */
    51     inline const std::vector<CollisionEvent*>& getCollisionEvents() const { return this->_collisionEvents; }
    5250
    5351    void flushCollisionEvents();
     
    5553
    5654    /** @returns iterator pointing to the beginning of the collision event vector */
    57     inline iterator       begin()        { return this->_collisionEvents.begin(); }
     55    inline Iterator       begin()        { return this->_collisionEvents.begin(); }
    5856    /** @returns const iterator pointing to the beginning of the collision event vector */
    59     inline const_iterator begin() const  { return this->_collisionEvents.begin(); }
     57    inline ConstIterator begin() const  { return this->_collisionEvents.begin(); }
    6058    /** @returns iterator pointing to the end of the collision event vector */
    61     inline iterator       end()          { return this->_collisionEvents.end(); }
     59    inline Iterator       end()          { return this->_collisionEvents.end(); }
    6260    /** @returns const iterator pointing to the end of the collision event vector */
    63     inline const_iterator end() const    { return this->_collisionEvents.end(); }
    64 
    65 
    66   private:
    67     collisionVector  _collisionEvents;               //!< the collision event list
    68 
     61    inline ConstIterator  end() const    { return this->_collisionEvents.end(); }
    6962
    7063
     
    7265  public:
    7366    /** @return Collision WorldEntity A */
    74     inline WorldEntity* getEntityA() const { return this->entityA; }
     67    inline WorldEntity* getEntityA() const { return this->_entityA; }
    7568    /** @return Collision WorldEntity B */
    76     inline WorldEntity* getEntityB() const { return this->entityB; }
     69    inline WorldEntity* getEntityB() const { return this->_entityB; }
    7770    inline bool match(const WorldEntity& entityA, WorldEntity& entityB) const {
    78       return ((this->entityA == &entityA && this->entityB == &entityB) || (this->entityA == &entityB && this->entityB == &entityA)); }
     71      return ((this->_entityA == &entityA && this->_entityB == &entityB) || (this->_entityA == &entityB && this->_entityB == &entityA)); }
    7972
    8073    /** @return true if Entity A collides */
    81     inline bool isEntityACollide() const { return this->entityACollide; }
     74    inline bool isEntityACollide() const { return this->_entityACollide; }
    8275    /** sets the flag if it reacts @param flag true if it should react on entityA*/
    83     inline void setEntityACollide(bool flag) { this->entityACollide = flag; }
     76    inline void setEntityACollide(bool flag) { this->_entityACollide = flag; }
    8477    /** @return true if Entity B collides */
    85     inline bool isEntityBCollide() const { return this->entityBCollide; }
     78    inline bool isEntityBCollide() const { return this->_entityBCollide; }
    8679    /** sets the flag if it reacts @param flag true if it should react on entityB*/
    87     inline void setEntityBCollide(bool flag) { this->entityACollide = flag; }
     80    inline void setEntityBCollide(bool flag) { this->_entityACollide = flag; }
    8881
    8982
     83  private:
     84    WorldEntity*                 _entityA;                       //!< the collision body A
     85    WorldEntity*                 _entityB;                       //!< the collision body B
     86    bool                         _entityACollide;                //!< true if entity A is subscribed for collision reaction
     87    bool                         _entityBCollide;                //!< true if entity B is subscribed for collision reaction
    9088
    91     /** @returns true if this Collision has already been dispatched */
    92     inline bool isDispatched() { return this->bDispatched; }
    93     /** sets the dispatched flag to true */
    94     inline void dispatched() { this->bDispatched = true; }
    95 
    96   private:
    97     WorldEntity*                 entityA;                       //!< the collision body A
    98     WorldEntity*                 entityB;                       //!< the collision body B
    99     bool                         entityACollide;                //!< true if entity A is subscribed for collision reaction
    100     bool                         entityBCollide;                //!< true if entity B is subscribed for collision reaction
    101 
    102     bool                         bDispatched;                   //!< true if this collision has already been dispatched
     89    collisionVector              _collisionEvents;               //!< the collision event list
    10390
    10491  };
  • branches/coll_rect/src/lib/collision_reaction/collision_tube.cc

    r9981 r9983  
    145145        if( (*ci)->getEntityA()->bReactibe((*it)->getEnityB(), i) || (*ci)->getEntityB()->bReactibe((*it)->getEnityA(), i))
    146146          (*ci)->reactToCollision(*ci);
     147
     148        (*ci)->flushCollisionEvents();
    147149      }
    148150    }
  • branches/coll_rect/src/lib/collision_reaction/collision_tube.h

    r9981 r9983  
    7070    void handleCollisions();
    7171
     72
    7273  private:
    7374    std::vector<Collision*>         _collisionList;                      //!< the list of collisions since the last processing
Note: See TracChangeset for help on using the changeset viewer.