Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9076 in orxonox.OLD


Ignore:
Timestamp:
Jul 4, 2006, 12:15:43 AM (18 years ago)
Author:
patrick
Message:

collision reaction for multiplayer works now

Location:
branches/presentation/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/lib/collision_reaction/cr_physics_ground_walk.cc

    r9065 r9076  
    209209
    210210
    211 #if 0
    212   if( box != NULL)
    213     height = ( ce->getCollisionPosition() - collision->getEntityB()->getAbsCoor() )*(-1.0f) ;
    214   else
    215     height = ce->getCollisionPosition() - collision->getEntityB()->getAbsCoor() ;
    216 
    217 
    218   if( box != NULL)
    219   {
    220 
    221 
    222     if(ce->getCollisionPosition().x <= 0.9 && ce->getGroundNormal().len() <= 1.4f)
    223     {
    224       collision->getEntityB()->setAbsCoor(collision->getEntityB()->getLastAbsCoor());
    225       return;
    226     }
    227     if(ce->getCollisionPosition().z <= 0.9 && ce->getGroundNormal().len() <= 1.4f)
    228     {
    229       collision->getEntityB()->setAbsCoor(collision->getEntityB()->getLastAbsCoor());
    230       return;
    231     }
    232 
    233     if(ce->getGroundNormal().len() <= 0.1f)
    234     {
    235       collision->getEntityB()->setAbsCoor(collision->getEntityB()->getLastAbsCoor());
    236       return;
    237     }
    238 
    239 
    240     if(ce->getGroundNormal().len() >= 1.4f)
    241     {
    242       downspeed++;
    243       collision->getEntityB()->setAbsCoor(collision->getEntityB()->getAbsCoor() + Vector(0.0,-0.08*downspeed,0.0));
    244       return;
    245     }
    246 
    247 
    248     if(height.y > box->halfLength[1] + 0.0f ) // Above ground
    249     {
    250       if(height.y < box->halfLength[1] + 2.3f) // Snap in
    251       {
    252         downspeed = 0;
    253         collision->getEntityB()->setAbsCoor(collision->getEntityB()->getAbsCoor() - Vector(0.0,height.y  - box->halfLength[1] - 0.0f,0.0));
    254       } else
    255       {
    256         downspeed++;
    257         collision->getEntityB()->setAbsCoor(collision->getEntityB()->getAbsCoor() + Vector(0.0,-0.08*downspeed,0.0));
    258       }
    259 
    260     }
    261     else
    262     {
    263       if(height.y <  box->halfLength[1] + 0.0f   /* && height.y  >  - 55.0f*/) // below ground
    264       {
    265         //if(downspeed <= 0) downspeed =1;
    266         collision->getEntityB()->setAbsCoor(collision->getEntityB()->getAbsCoor() + Vector(0.0, -height.y  +  box->halfLength[1] + 2.0f,0.0));
    267         //collision->getEntityB()->setVelocity(Vector(0.0,0.0,0.0));
    268         downspeed = 0;
    269       }
    270 
    271     }
    272 
    273   }// if(box!= NULL)
    274 #endif
    275   /*
    276   PRINTF(0)("Collision with Ground: \n");
    277   collision->getEntityB()->getAbsCoor().debug();
    278   collision->getEntityB()->setVelocity(Vector());
    279   collision->getEntityB()->setAbsCoor(this->lastPositions[1]);
    280 
    281   */
    282211
    283212}
  • branches/presentation/src/story_entities/multi_player_world.cc

    r9059 r9076  
    129129  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    130130    this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
     131
     132
     133
     134    // ground collision detection: BSP Model
     135  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_00));
     136  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_01));
     137  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_PLAYERS));
    131138}
    132139
     
    153160
    154161  State::setOnline( false );
    155  
     162
    156163  return ErrorMessage();
    157164}
Note: See TracChangeset for help on using the changeset viewer.