Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7940 in orxonox.OLD


Ignore:
Timestamp:
May 28, 2006, 11:05:21 PM (18 years ago)
Author:
patrick
Message:

cr: init and reset phases

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

Legend:

Unmodified
Added
Removed
  • branches/cr/src/lib/collision_reaction/Makefile.am

    r7935 r7940  
    1212noinst_HEADERS =     cr_engine.h \
    1313                     collision.h \
    14                      collision_handle.h
     14                     collision_handle.h \
     15                     cr_defs.h
    1516
  • branches/cr/src/lib/collision_reaction/collision.cc

    r7935 r7940  
    1414*/
    1515
    16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_COLLISION_DETECTION
     16#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_COLLISION_REACTION
    1717
    1818#include "collision.h"
     
    2020using namespace std;
    2121
     22#define NULL 0
    2223
    2324/**
     
    2627Collision::Collision ()
    2728{
     29  this->entityA = NULL;
     30  this->entityB = NULL;
     31  this->bvA = NULL;
     32  this->bvB = NULL;
    2833}
    2934
  • branches/cr/src/lib/collision_reaction/collision.h

    r7935 r7940  
    1717
    1818 public:
    19   Collision();
     19   Collision();
    2020  virtual ~Collision();
    2121
     22  /** collides two WorldEntities @param entityA world entity A, @param entityB world entity B, @param bvA volume A @param bvB volumeB */
     23  inline void collide(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB)
     24  { this->entityA = entityA; this->entityB = entityB; this->bvA = bvA; this->bvB = bvB; }
     25
     26
     27  /** @return Collision WorldEntity A */
     28  inline const WorldEntity* getEntityA() const { return this->entityA; }
     29  /** @return Collision WorldEntity B */
     30  inline const WorldEntity* getEntityB() const { return this->entityB; }
     31  /** @return Bounding Volume from EntityA */
     32  inline const BoundingVolume* getBVA() const { return this->bvA; }
     33  /** @return Bounding Volume from EntityB */
     34  inline const BoundingVolume* getBVB() const { return this->bvB; }
    2235
    2336
  • branches/cr/src/lib/collision_reaction/cr_engine.cc

    r7937 r7940  
    1616#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_COLLISION_REACTION
    1717
     18
     19
     20#include "collision.h"
     21#include "cr_defs.h"
     22
    1823#include "cr_engine.h"
    1924
     
    3035   this->setName("CREngine");
    3136
     37   this->init();
    3238}
    3339
     
    4551}
    4652
     53
     54void CREngine::init()
     55{
     56  // create a list of Collision events (precaching)
     57  Collision* collisions = new Collision[CR_MAX_COLLISIONS];
     58  for( int i = 0; i < CR_MAX_COLLISIONS; i++)
     59    this->cachedCollisions.push_back(collisions[i]);
     60}
     61
     62
     63void CREngine::reset()
     64{}
    4765
    4866
     
    7492
    7593}
     94
  • branches/cr/src/lib/collision_reaction/cr_engine.h

    r7937 r7940  
    4141  inline static CREngine* getInstance() { if (!singletonRef) singletonRef = new CREngine();  return singletonRef; };
    4242
     43  void init();
     44  void reset();
     45
     46
    4347  CollisionHandle* subscribeReaction(WorldEntity* worldEntity, CRType type);
    4448
Note: See TracChangeset for help on using the changeset viewer.