Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9084 in orxonox.OLD for branches


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

one half x made

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/lib/graphics/importer/bsp_manager.cc

    r9081 r9084  
    11511151
    11521152  bool SolidFlag = false;
    1153   bool collision = false;
    1154   Vector position1 = position;
    1155   Vector position2 = position + Vector(0.0,1.0,0.0);
    1156   Vector position3 = position;
    1157   Vector position4 = position + Vector(0.0,1.0,0.0);
    1158   Vector dest = entity->getAbsCoor() - upDir*40.0f; //
    1159 
    1160   Vector dest3 = position + forwardDir * 4.0f;
    1161   Vector dest4 = position2 + forwardDir * 4.0;
    1162   dest = position - Vector(0.0, 40.0,0.0);
    1163   Vector out = dest;
    1164   Vector out1;
    1165   Vector out2;
    1166 
    1167 
    1168   plane* testPlane;
     1153
     1154  plane* testPlane = NULL;
    11691155
    11701156  bool xCollision = false;
    1171   bool zCollision = false;
     1157
    11721158
    11731159  Vector            left;                       //!< left collision ray
    11741160  Vector            right;                      //!< right collision ray
    1175 
    1176   Vector dest1;
    1177 
    1178   float height = 40;
     1161  Vector            collPos;                    //!< the collision position
     1162
     1163
     1164
    11791165
    11801166  Vector dirX =  entity->getAbsDirX(); dirX.y = 0.0f; dirX.normalize();
     
    11871173  else
    11881174  {
    1189     left  = position + forwardDir*4.0f;
    1190     right = position2 + forwardDir*4.0;
    1191   }
    1192 
    1193     //
     1175    Vector position2 = position + Vector(0.0, 1.0,0.0);
     1176    Vector position3 = position;
     1177    Vector position4 = position + Vector(0.0, 1.0, 0.0);
     1178
     1179    left  = position + forwardDir * 4.0f;
     1180    right = position2 + forwardDir * 4.0;
     1181  }
     1182
    11941183//     dest1
    11951184//     dest2
    11961185
    11971186
    1198     // 2nd Collision Detection X-RAY
     1187  /*   X Ray Left  */
     1188  // init some member variables before collision check
    11991189  this->outputStartsOut = true;
    12001190  this->outputAllSolid = false;
    12011191  this->outputFraction = 1.0f;
    1202   this->inputStart =  position1;
    1203 //   this->inputEnd =   dest1;                                                 <===============
    1204 //  this->checkCollisionRayN(this->root,0.0f,1.0f, &position1, &dest1 );
    1205 
    1206   if(this->outputFraction < 1.0f) {
    1207     out.x = dest1.x + (dest1.x -position1.x) * this->outputFraction;
    1208     dest1 = position1 + (dest1 -position1) * this->outputFraction;
     1192  this->inputStart =  position;
     1193  this->inputEnd =   right;
     1194  this->checkCollisionRayN(this->root,0.0f,1.0f, &position, &right );
     1195
     1196  // collision occured
     1197  if( this->outputFraction < 1.0f)
     1198  {
     1199    collPos = position + (right - position) * this->outputFraction;
    12091200    xCollision = true;
    12101201    testPlane = this->collPlane;
    12111202  }
    1212   if(this->outputAllSolid ) {
    1213 
     1203  if(this->outputAllSolid )
     1204  {
    12141205    this->collPlane = new plane;
    12151206    this->collPlane->x = 0.0f;
     
    12201211    xCollision = true;
    12211212  }
    1222     //out.z = this->outputFraction;
    1223 
    1224 
    1225 
     1213
     1214  // collision registration
    12261215  if( xCollision) {
    1227     entity->registerCollision(COLLISION_TYPE_AXIS_X , this->parent, entity,
    1228                                    Vector(testPlane->x, testPlane->y, testPlane->z),dest1 ,
    1229                                    SolidFlag);
     1216    entity->registerCollision(COLLISION_TYPE_AXIS_X ,
     1217                              this->parent, entity,
     1218                              Vector(testPlane->x, testPlane->y, testPlane->z),
     1219                              collPos,
     1220                              SolidFlag);
    12301221  }
    12311222
Note: See TracChangeset for help on using the changeset viewer.