Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7989 in orxonox.OLD


Ignore:
Timestamp:
May 30, 2006, 7:23:23 PM (18 years ago)
Author:
patrick
Message:

cr: other interface, no stdarg

Location:
branches/cr/src
Files:
4 edited

Legend:

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

    r7973 r7989  
    3434  this->owner = owner;
    3535  this->type = type;
    36 
    37   this->targetList.clear();
    3836}
    3937
     
    6058 *  @param classID the classid to look for
    6159 */
    62 void CollisionHandle::addTarget(long classID)
     60void CollisionHandle::addTarget(long target)
    6361{
    64   printf("addTarget: %i this is target nr %i\n", classID, this->targetList.size());
     62  PRINTF(0)("addTarget: %i \n", target);
    6563  // make sure there is no dublicate
    6664//   for(int i = 0; i < this->targetList.size(); ++i)
     
    7371//       return;
    7472
     73
    7574  // add element
    76   this->targetList.push_back(classID);
     75  this->targetList.push_back(target);
    7776}
    7877
  • branches/cr/src/lib/collision_reaction/collision_handle.h

    r7967 r7989  
    1111
    1212#include <vector>
     13#include <list>
    1314
    1415
     
    2829    void reset();
    2930
    30     void addTarget(long classID);
     31    void addTarget(long target);
    3132    Collision* registerCollision(WorldEntity* entityA, WorldEntity* entityB);
    3233    void registerCollisionEvent(CollisionEvent* collisionEvent);
  • branches/cr/src/world_entities/world_entity.cc

    r7970 r7989  
    7676
    7777  // registering default reactions:
    78   this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, 1, CL_WORLD_ENTITY);
    79   this->subscribeReaction(CREngine::CR_PHYSICS_GROUND, 1, CL_TERRAIN);
     78  this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, CL_WORLD_ENTITY);
     79  this->subscribeReaction(CREngine::CR_PHYSICS_GROUND, CL_TERRAIN);
    8080
    8181  this->toList(OM_NULL);
     
    249249 * subscribes this world entity to a collision reaction
    250250 *  @param type the type of reaction to subscribe to
     251 *  @param target1 a filter target (classID)
     252 */
     253void WorldEntity::subscribeReaction(CREngine::CRType type, long target1)
     254{
     255  this->subscribeReaction(type);
     256
     257  // add the target filter
     258  this->collisionHandles[type]->addTarget(target1);
     259}
     260
     261
     262/**
     263 * subscribes this world entity to a collision reaction
     264 *  @param type the type of reaction to subscribe to
     265 *  @param target1 a filter target (classID)
     266 */
     267void WorldEntity::subscribeReaction(CREngine::CRType type, long target1, long target2)
     268{
     269  this->subscribeReaction(type);
     270
     271  // add the target filter
     272  this->collisionHandles[type]->addTarget(target1);
     273  this->collisionHandles[type]->addTarget(target2);
     274}
     275
     276
     277/**
     278 * subscribes this world entity to a collision reaction
     279 *  @param type the type of reaction to subscribe to
     280 *  @param target1 a filter target (classID)
     281 */
     282void WorldEntity::subscribeReaction(CREngine::CRType type, long target1, long target2, long target3)
     283{
     284  this->subscribeReaction(type);
     285
     286  // add the target filter
     287  this->collisionHandles[type]->addTarget(target1);
     288  this->collisionHandles[type]->addTarget(target2);
     289  this->collisionHandles[type]->addTarget(target3);
     290}
     291
     292
     293/**
     294 * subscribes this world entity to a collision reaction
     295 *  @param type the type of reaction to subscribe to
     296 *  @param target1 a filter target (classID)
     297 */
     298void WorldEntity::subscribeReaction(CREngine::CRType type, long target1, long target2, long target3, long target4)
     299{
     300  this->subscribeReaction(type);
     301
     302  // add the target filter
     303  this->collisionHandles[type]->addTarget(target1);
     304  this->collisionHandles[type]->addTarget(target2);
     305  this->collisionHandles[type]->addTarget(target3);
     306  this->collisionHandles[type]->addTarget(target4);
     307}
     308
     309
     310/**
     311 * subscribes this world entity to a collision reaction
     312 *  @param type the type of reaction to subscribe to
    251313 *  @param nrOfTargets number of target filters
    252314 *  @param ... the targets as classIDs
    253315 */
    254 void WorldEntity::subscribeReaction(CREngine::CRType type, int nrOfTargets, long target...)
     316void WorldEntity::subscribeReaction(CREngine::CRType type)
    255317{
    256318  if( this->collisionHandles[type] != NULL)  {
     
    260322
    261323  this->collisionHandles[type] = CREngine::getInstance()->subscribeReaction(this, type);
    262 
    263   // add the target filter
    264   va_list itemlist;
    265   va_start (itemlist, target);
    266   for (int i = 0; i < nrOfTargets; i++)
    267     this->collisionHandles[type]->addTarget(va_arg(itemlist, long));
    268   va_end(itemlist);
    269324
    270325  // now there is at least one collision reaction subsribed
  • branches/cr/src/world_entities/world_entity.h

    r7958 r7989  
    7070
    7171  /* --- Collision Reaction Block --- */
    72   void subscribeReaction(CREngine::CRType type, int nrOfTargets, long target, ...);
     72  void subscribeReaction(CREngine::CRType type);
     73  void subscribeReaction(CREngine::CRType type, long target1);
     74  void subscribeReaction(CREngine::CRType type, long target1, long target2);
     75  void subscribeReaction(CREngine::CRType type, long target1, long target2, long target3);
     76  void subscribeReaction(CREngine::CRType type, long target1, long target2, long target3, long target4);
     77
    7378  void unsubscribeReaction(CREngine::CRType type);
    7479  void unsubscribeReaction();
Note: See TracChangeset for help on using the changeset viewer.