Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8317 in orxonox.OLD for branches/bsp_model/src/lib/graphics


Ignore:
Timestamp:
Jun 11, 2006, 2:15:24 PM (18 years ago)
Author:
bottac
Message:

collision detection: partial fix.

Location:
branches/bsp_model/src/lib/graphics/importer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/lib/graphics/importer/bsp_file.cc

    r8233 r8317  
    214214    bspFile.read(this->visData, size);
    215215
    216     PRINTF(4)("BSP FILE: VisDataSize: %i Bytes. \n", size);
    217     PRINTF(4)("BSP FILE: NumVisData: %i. \n", size /1 - 8);
    218     PRINTF(4)("BSP FILE: Remainder: %i. \n", size % 1);
    219     PRINTF(4)("BSP FILE: VisDataOffset: %i. \n", offset);
     216    PRINTF(0)("BSP FILE: VisDataSize: %i Bytes. \n", size);
     217    PRINTF(0)("BSP FILE: NumVisData: %i. \n", size /1 - 8);
     218    PRINTF(0)("BSP FILE: Remainder: %i. \n", size % 1);
     219    PRINTF(0)("BSP FILE: VisDataOffset: %i. \n", offset);
    220220
    221221    // Get the Textures
     
    391391{
    392392  ::std::string absFileName;
    393    char* baseName = "/worlds/bsp";
     393  char* baseName = "/worlds/bsp/";
    394394
    395395  char fileName [500];
  • branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc

    r8288 r8317  
    103103const void BspManager::tick(float time)
    104104{
    105   //if(!this->bspFile->MovieMaterials.empty())
    106   //this->bspFile->MovieMaterials.front()->tick(time );
    107 
     105 
     106  if(!this->bspFile->MovieMaterials.empty())
     107  {
     108      ::std::vector<MoviePlayer *>::iterator it = this->bspFile->MovieMaterials.begin() ;
     109      while(it != this->bspFile->MovieMaterials.end())
     110      {
     111         (*it)->tick(time);
     112        it++;
     113      }
     114 //this->bspFile->MovieMaterials.front()->tick(time );
     115 
     116 
     117  }
     118 
    108119}
    109120const void BspManager::draw()
     
    302313    return;
    303314  }
    304   if(curFace.type != 1) return;
     315 // if(curFace.type != 1) return;
    305316  if((char*)(this->bspFile->textures)[curFace.texture*72]== 0) return;
    306317
    307318  if(this->lastTex != curFace.texture) {
    308319    if(this->bspFile->Materials[curFace.texture].animated) {
    309       glBlendFunc(GL_ZERO,GL_ONE);
    310       //glEnable(GL_BLEND);
     320     // glBlendFunc(GL_ZERO,GL_ONE);
     321   
     322   
     323     
    311324      if(this->bspFile->Materials[curFace.texture].aviMat->getStatus() == 2) this->bspFile->Materials[curFace.texture].aviMat->start(0);
    312325      //this->bspFile->Materials[curFace.texture].aviMat->tick(0.005);
     
    314327      glActiveTextureARB(GL_TEXTURE0_ARB);
    315328      glBindTexture(GL_TEXTURE_2D, n );
    316      // glDisable(GL_BLEND);
     329      this->lastTex = curFace.texture;
     330     
    317331    } else {
    318332      this->bspFile->Materials[curFace.texture].mat->select();
     
    322336
    323337  if(curFace.lm_index < 0) {
     338    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    324339    glActiveTextureARB(GL_TEXTURE1_ARB);
    325340    glBindTexture(GL_TEXTURE_2D, this->bspFile->whiteLightMap );
     
    922937
    923938    this->checkCollisionRayN(this->root,0.0f,1.0f, &position, &dest );
    924     if(this->outputFraction == 1.0f) out = dest;
     939    if(this->outputFraction == 1.0f)
     940    {
     941      if(this->outputAllSolid) collision = true;
     942      else collision = false;
     943      out = dest;
     944     
     945    }
    925946    else {
     947     
    926948      collision = true;
    927949      out.x = position.x + (dest.x -position.x) * this->outputFraction;
     
    944966    // Return the normal here: Normal's stored in this->collPlane;
    945967
    946     if(collision) {
     968    if(collision ) {
    947969      PRINTF(0)("We got a collision!! Are you sure: outputFraction = %f\n", this->outputFraction);
    948970      worldEntity->registerCollision(this->parent, worldEntity, Vector(this->collPlane->x, this->collPlane->y, this->collPlane->z), out);
  • branches/bsp_model/src/lib/graphics/importer/bsp_manager.h

    r8219 r8317  
    109109  Vector out1; //!< For debugging only
    110110  Vector out2; //!< For debugging only
     111                       
     112  int tgl;
    111113};
    112114
Note: See TracChangeset for help on using the changeset viewer.