Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

collision detection: partial fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.