Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8219 in orxonox.OLD


Ignore:
Timestamp:
Jun 7, 2006, 10:15:00 PM (18 years ago)
Author:
patrick
Message:

bsp: new ground collision attribute tripple

Location:
branches/bsp_model/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/lib/collision_reaction/collision_event.h

    r8216 r8219  
    2525  { this->entityA = entityA; this->entityB = entityB; this->bvA = bvA; this->bvB = bvB; }
    2626  /** collides two WorldEntities @param entity world entity , @param ground ground plane, @param position position on the ground */
    27   inline void collide(WorldEntity* entity, Vector normal, Vector position)
    28   { this->entityA = entity; this->groundNormal = normal; this->position = position; }
     27  inline void collide(WorldEntity* entity, WorldEntity* groundEntity, Vector normal, Vector position)
     28  { this->entityA = entity; this->entityB = groundEntity, this->groundNormal = normal; this->position = position; }
    2929
    3030
  • branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc

    r8218 r8219  
    4848//CREATE_FACTORY( BspManager, CL_BSP_MODEL);
    4949
    50 BspManager::BspManager()
    51 {
     50BspManager::BspManager(WorldEntity* parent)
     51{
     52  this->parent = parent;
    5253  /*// open a BSP file
    5354  this->bspFile = new BspFile();
     
    917918    // Return the normal here: Normal's stored in this->collPlane;
    918919   if(collision)
    919      worldEntity->registerCollision(worldEntity, Vector(this->collPlane->x, this->collPlane->y, this->collPlane->z), out);
     920     worldEntity->registerCollision(worldEntity, this->parent, Vector(this->collPlane->x, this->collPlane->y, this->collPlane->z), out);
    920921}
    921922
  • branches/bsp_model/src/lib/graphics/importer/bsp_manager.h

    r8218 r8219  
    5151public:
    5252  // Constructors
    53   BspManager();
     53  BspManager(WorldEntity* parent);
    5454
    5555  BspManager(const char* fileName, float scale = 0.4f);
     
    9999                            For example, if traceMins was (-100,-3,-15) and traceMaxs was (55,22,7), traceExtents */
    100100
     101  WorldEntity* parent;          //!< the parent entity of the bspManager: interface to this
    101102
    102103  bool * alreadyVisible;
  • branches/bsp_model/src/world_entities/bsp_entity.cc

    r8218 r8219  
    4242void BspEntity::setName(const std::string& name)
    4343{
    44   printf("+++++++++++ LOADING NAME %s\n", name.c_str());
     44  PRINTF(0)("+++++++++++ LOADING NAME %s\n", name.c_str());
    4545
    4646  this->bspManager->load(name.c_str(), 0.1f);
     
    5555void BspEntity::init()
    5656{
    57   this->bspManager = new BspManager();
     57  this->bspManager = new BspManager(this);
    5858  this->setClassID(CL_BSP_ENTITY, "BspEntity");
    5959
  • branches/bsp_model/src/world_entities/world_entity.cc

    r8216 r8219  
    410410 *  @param position it collides on the plane
    411411 */
    412 bool WorldEntity::registerCollision(WorldEntity* entity, Vector normal, Vector position)
     412bool WorldEntity::registerCollision(WorldEntity* entity, WorldEntity* groundEntity, Vector normal, Vector position)
    413413{
    414414  // is there any handler listening?
     
    419419  CollisionEvent* c = CREngine::getInstance()->popCollisionEventObject();
    420420  assert(c != NULL); // if this should fail: we got not enough precached CollisionEvents: alter value in cr_defs.h
    421   c->collide(entity, normal, position);
     421  c->collide(entity, groundEntity, normal, position);
    422422
    423423  for( int i = 0; i < CREngine::CR_NUMBER; ++i)
  • branches/bsp_model/src/world_entities/world_entity.h

    r8216 r8219  
    8585
    8686  bool registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB);
    87   bool registerCollision(WorldEntity* entity, Vector normal, Vector position);
     87  bool registerCollision(WorldEntity* entity, WorldEntity* groundEntity, Vector normal, Vector position);
    8888  /** @return true if there is at least on collision reaction subscribed */
    8989  inline bool isReactive() const { return this->bReactive; }
Note: See TracChangeset for help on using the changeset viewer.