Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7932 in orxonox.OLD for branches/cr/src/lib/collision_reaction


Ignore:
Timestamp:
May 28, 2006, 9:00:40 PM (18 years ago)
Author:
patrick
Message:

cr: reaction subscription stuff

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

Legend:

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

    r7927 r7932  
    1616
    1717#include "collision_handle.h"
     18
     19
     20
    1821
    1922using namespace std;
     
    4144  // delete what has to be deleted here
    4245}
     46
     47
     48/**
     49 * add more filter targets to this collision handle
     50 *  @param classID the classid to look for
     51 */
     52void CollisionHandle::addTarget(long classID)
     53{
     54  // make sure there is no dublicate
     55  std::vector<long>::iterator it;
     56  for(  it = this->targetList.begin(); it != this->targetList.end(); it++)
     57    if(*it == classID)
     58      return;
     59
     60  // add element
     61  this->targetList.push_back(classID);
     62}
  • branches/cr/src/lib/collision_reaction/collision_handle.h

    r7927 r7932  
    2727
    2828
    29   void addTarget();
     29  void addTarget(long classID);
    3030
    3131  void registerCollision(Collision* collision);
  • branches/cr/src/lib/collision_reaction/cr_engine.cc

    r7927 r7932  
    4747
    4848
    49 CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, CRType type, int nrOfTargets, ...)
     49CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, CRType type)
    5050{
    5151
    52   va_list itemlist;
    53   va_start (itemlist, type);
    54 //  for (int i = 0; i < nrOfTargets; i++)
    55   //  this->targetList.push_back(va_arg(itemlist, int));
    56   va_end(itemlist);
    5752}
    5853
  • branches/cr/src/lib/collision_reaction/cr_engine.h

    r7927 r7932  
    4141  inline static CREngine* getInstance(void) { if (!singletonRef) singletonRef = new CREngine();  return singletonRef; };
    4242
    43 
    44   CollisionHandle* subscribeReaction(WorldEntity* worldEntity, CRType type, int nrOfTargets, ...);
     43  CollisionHandle* subscribeReaction(WorldEntity* worldEntity, CRType type);
    4544
    4645  bool unsubscribeReaction(WorldEntity* worldEntity);
     
    5150
    5251  /** @returns an instance to a collision object. instead of creating new object this ones can be resycled */
    53 inline Collision* getCollisionObject() { /* return the first element of the cache list*/ }
     52  inline Collision* getCollisionObject() { /* return the first element of the cache list*/ }
    5453  /** @param collision: returns the Collision object back to the cache list */
    5554  inline void putCollisionObject(Collision* collision) { this->cachedCollisions.push_back(collision); }
Note: See TracChangeset for help on using the changeset viewer.