Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8256 in orxonox.OLD


Ignore:
Timestamp:
Jun 8, 2006, 3:47:40 PM (18 years ago)
Author:
patrick
Message:

bsp: some cr default values rearangements

Location:
branches/bsp_model/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/defs/class_id.h

    r8190 r8256  
    121121  CL_STATE                      =    0x00000013,
    122122  CL_FRAMEWORK                  =    0x00000014,
    123   CL_CR_ENGINE                  =    0x00000015,                ///FIXME bensch i just added this id, verify if this is ok :D
     123  CL_CR_ENGINE                  =    0x00000015,
    124124  CL_RENDER_2D                  =    0x00000021,
    125125  CL_NULL_ELEMENT_2D            =    0x00000022,
     
    252252
    253253  /// Collision
    254   CL_COLLISION                  =    0x00000711,
     254  CL_COLLISION                  =    0x00780000,
    255255  CL_COLLISION_HANDLE           =    0x00000712,
    256256  CL_COLLISION_REACTION         =    0X00000713,
     
    258258  CL_CR_PHYSICS_GROUND          =    0X00000715,
    259259  CL_CR_PHYSICS_GROUND_WALK     =    0X00000716,
    260   CL_CR_OBJECT_DAMAGE          =    0X00000717,
     260  CL_CR_OBJECT_DAMAGE           =    0X00000717,
    261261  CL_CR_OBJECT_PICKUP           =    0X00000718,
    262262  CL_CR_VERTEX_TRAFO            =    0X00000719,
     
    271271  CL_OBB                        =    0x00720000,
    272272  CL_BOUNDING_SPHERE            =    0x00740000,
    273  
     273
    274274
    275275
     
    298298  CL_HEIGHT_MAP                 =    0x0000090a,
    299299  CL_GRID                       =    0x0000090b,
    300   CL_BSP_MODEL                  =    0x0000090c, //!FIXME 
    301  
     300  CL_BSP_MODEL                  =    0x0000090c, //!FIXME
     301
    302302  CL_MATERIAL                   =    0x00000810,
    303303  CL_SHADER                     =    0x00000811,
  • branches/bsp_model/src/lib/collision_reaction/collision.h

    r8203 r8256  
    2727
    2828    /** collides two WorldEntities @param entityA world entity A, @param entityB world entity B, @param bvA volume A @param bvB volumeB */
    29     inline void collide(WorldEntity* entityA, WorldEntity* entityB) { this->entityA = entityA; this->entityB = entityB; }
     29    inline void collide(WorldEntity* entityA, WorldEntity* entityB) { this->entityA = entityA; this->entityB = entityB; this->bDispatched = false; }
    3030
    3131
  • branches/bsp_model/src/lib/collision_reaction/collision_handle.cc

    r8220 r8256  
    4141
    4242  this->bCollided = false;
    43   this->bDispatched = false;
     43  this->bDispatched = true;
    4444
    4545  this->collisionReaction = NULL;
    46   this->bContinuousPoll = true;
     46  this->bContinuousPoll = false;
    4747  this->bStopOnFirstCollision = false;
    4848
     
    5656    case CREngine::CR_PHYSICS_GROUND_WALK:
    5757      this->collisionReaction = new CRPhysicsGroundWalk();
     58      this->bContinuousPoll = true;
    5859      break;
    5960    case CREngine::CR_OBJECT_DAMAGE:
     
    191192void CollisionHandle::handleCollisions()
    192193{
     194//   if( this->type == CREngine::CR_)
     195
    193196  // collision reaction calculations (for every collision there will be a reaction)
    194197  vector<Collision*>::iterator it = this->collisionList.begin();
     
    205208  this->bCollided = false;
    206209
     210  // if continuous poll poll the reaction
     211   if( this->bContinuousPoll)
     212     this->collisionReaction->update(this->owner);
    207213  this->flushCollisions();
    208214}
     
    215221bool CollisionHandle::filterCollisionEvent(CollisionEvent* collisionEvent)
    216222{
     223  if( this->type == CREngine::CR_PHYSICS_GROUND_WALK)
     224  {
     225
     226    vector<long>::iterator it = this->targetList.begin();
     227    for(; it < this->targetList.end(); it++)
     228    {
     229      PRINTF(0)("filtering: %i vs EntityA %i, EntityB %i \n", *it, collisionEvent->getEntityA()->getClassID(), collisionEvent->getEntityB()->getClassID());
     230
     231    }
     232  }
     233
    217234  vector<long>::iterator it = this->targetList.begin();
    218235  for(; it < this->targetList.end(); it++)
  • branches/bsp_model/src/lib/collision_reaction/collision_reaction.h

    r8190 r8256  
    1212
    1313class Collision;
     14class WorldEntity;
     15
    1416
    1517//! A class representing a simple collision
     
    2325    virtual void reactToCollision(Collision* collision) = 0;
    2426
     27    virtual void update(WorldEntity* owner) {}
     28
     29    /** use this to do some collision offline calculations, only called for bContinuousPoll == true */
    2530    inline bool isContinuousPoll() const { return this->bContinuousPoll; }
    2631
  • branches/bsp_model/src/lib/collision_reaction/cr_engine.cc

    r8234 r8256  
    143143  for( it = this->collisionHandles.begin(); it != this->collisionHandles.end(); it++)
    144144  {
    145     if( (*it)->isCollided() || (*it)->isContinuousPoll())  //does it have any collisions to report at all
     145    if( !(*it)->isDispatched() || (*it)->isContinuousPoll())  //does it have any collisions to report at all
    146146    {
    147       PRINTF(0)("CREngine: handle %i\n", (*it)->getType());
    148147      (*it)->handleCollisions();
    149148    }
  • branches/bsp_model/src/lib/collision_reaction/cr_physics_ground_walk.cc

    r8234 r8256  
    3434{
    3535  this->setClassID(CL_CR_PHYSICS_GROUND_WALK, "CRPhysicsGroundWalk");
    36 
    3736}
    3837
     
    5453//   Vector normal = collision
    5554  PRINTF(0)("Ground\n");
     55}
     56
     57
     58
     59/**
     60 * use this to do some collision offline calculations, only called for bContinuousPoll == true
     61 */
     62void CRPhysicsGroundWalk::update(WorldEntity* owner)
     63{
     64  this->lastPosition = owner->getAbsCoor();
     65  this->lastDirection = owner->getAbsDir();
     66
    5667
    5768}
    5869
     70
  • branches/bsp_model/src/lib/collision_reaction/cr_physics_ground_walk.h

    r8221 r8256  
    2121    virtual void reactToCollision(Collision* collision);
    2222
     23    virtual void update(WorldEntity* entity);
     24
    2325  private:
    2426    Vector       lastPosition;                //!< vector with the last valid position
    25     Quaternion   lastDireciton;               //!< quat with the last valid direction
     27    Quaternion   lastDirection;               //!< quat with the last valid direction
    2628};
    2729
  • branches/bsp_model/src/lib/coord/p_node.h

    r8186 r8256  
    103103  /** @returns the absolute position */
    104104  inline const Vector& getAbsCoor () const { return this->absCoordinate; };
     105  /** @returns the absolute position */
     106  inline const Vector& getLastAbsCoor () const { return this->lastAbsCoordinate; };
    105107  void shiftCoor (const Vector& shift);
    106108  void shiftCoor (float x, float y, float z) { this->shiftCoor(Vector(x, y, z)); };
     
    238240    float roty;
    239241    float rotz;
    240    
     242
    241243  private:
    242244    int relCoordinate_handle;
     
    244246    Vector relCoordinate_write;
    245247    Quaternion relDirection_write;
    246    
     248
    247249  public:
    248250    virtual void varChangeHandler( std::list<int> & id );
Note: See TracChangeset for help on using the changeset viewer.