Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8887 in orxonox.OLD for branches


Ignore:
Timestamp:
Jun 28, 2006, 9:11:54 PM (18 years ago)
Author:
bottac
Message:

Started to move collision detection / reaction to the new interface.

Location:
branches/single_player_map/src/lib
Files:
2 edited

Legend:

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

    r8865 r8887  
    968968  Vector out = dest;
    969969
    970 
     970 
     971  bool SolidFlag = false;
    971972  bool collision = false;
    972973  Vector position1 = position;
     
    998999  else
    9991000  {
     1001    // Init positions and destinations to anything useful!
    10001002
    10011003  }
     
    10251027        this->collPlane->z = 0.0f;
    10261028        collision = true;
     1029        SolidFlag = true;
    10271030      } else
    10281031        collision = false;
     
    10461049  plane* testPlane = this->collPlane;
    10471050
     1051 
     1052  bool xCollision = false;
     1053  bool zCollision = false;
     1054  if(!SolidFlag)
     1055  {
    10481056
    10491057  // 2nd Collision Detection
     
    10551063  this->checkCollisionRayN(this->root,0.0f,1.0f, &position1, &dest1 );
    10561064  out.x = this->outputFraction;
     1065  xCollision = true;
    10571066  //out.z = this->outputFraction;
    10581067
     1068  if(!SolidFlag)
     1069  {
    10591070
    10601071    // 3rd Collision Detection
     
    10671078  //out.x = this->outputFraction;
    10681079  out.z = this->outputFraction;
    1069 
    1070 
     1080  if(this->outputFraction != 1.0 )
     1081    zCollision = true;
     1082  }
     1083  }
    10711084  /*
    10721085  This is how you would calculate the Coordinates where worldEntity Collided with the BSP world.
     
    10821095    worldEntity->registerCollision(COLLISION_TYPE_AXIS_Y, this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z), out, false);
    10831096  }
    1084   else  worldEntity->registerCollision(COLLISION_TYPE_AXIS_Y, this->parent, worldEntity, Vector(0.0, 2.0, 0.0), dest, false);
     1097  else
     1098  {
     1099    if(xCollision || yCollision)
     1100    {
     1101     
     1102      worldEntity->registerCollision((xCollision ? COLLISION_TYPE_AXIS_X :0) | (zCollision ? COLLISION_TYPE_AXIS_Z :0) , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z), out, false);
     1103    }
     1104   
     1105  }
     1106  //else  worldEntity->registerCollision(COLLISION_TYPE_AXIS_Y, this->parent, worldEntity, Vector(0.0, 2.0, 0.0), dest, false);
    10851107
    10861108}
  • branches/single_player_map/src/lib/shell/shell_command.cc

    r8350 r8887  
    373373    else
    374374    {
    375       delete this->completors[parameter];
     375      if(this->completors[parameter] == NULL)
     376      //delete this->completors[parameter];
    376377      this->completors[parameter] = completorPlugin.clone();
    377378    }
Note: See TracChangeset for help on using the changeset viewer.