Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 31, 2006, 3:22:23 PM (18 years ago)
Author:
bottac
Message:

bsp_manager now knows the normals of the planes into which an obj collided.

File:
1 edited

Legend:

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

    r7805 r8030  
    4343int BspFile::read(const char* name)
    4444{
     45  this->scale = 0.4;
    4546  int offset;
    4647  int size;
     
    598599  sc =  ((unsigned char *)(&lightMapTexture))[i];
    599600  sc *= 1/255.0;
    600   scale = 1.0;
     601  scale = 1.4;
    601602  if(sc > 1.0f && (temp = (1.0f/sc)) < scale) scale=temp;
    602603  scale*=255.0;
    603604  sc*=scale;
    604   if(sc <= 180)
     605  if(false)
    605606    ((unsigned char *)(&lightMapTexture))[i] = (unsigned char)sc + 75;
    606607  else
     
    983984void BspFile::swapAllBspCoordinates()
    984985{
     986 
    985987  for(int i = 0; i < this->numVertex ; ++i)
    986988  {
     
    10011003  {
    10021004    float sto = this->planes[i].x;
    1003     this->planes[i].x = this->planes[i].y;
    1004     this->planes[i].y = this->planes[i].z;
     1005    this->planes[i].x =  this->planes[i].y;
     1006    this->planes[i].y =  this->planes[i].z;
    10051007    this->planes[i].z = sto;
     1008    this->planes[i].d = scale * this->planes[i].d ;
    10061009  }
    10071010
     
    10211024{
    10221025  int sto  =  array[0];
    1023   array[0] =  array[1];
    1024   array[1] =  array[2];
    1025   array[2] =  sto;
     1026  array[0] =  array[1] / (int) ( 1/ scale);
     1027  array[1] = array[2] / (int) (1/scale);
     1028  array[2] =  sto / (int) (1/scale);
    10261029 
    10271030}
     
    10301033{
    10311034  float sto  =  array[0];
    1032   array[0] =  array[1];
    1033   array[1] =  array[2];
    1034   array[2] =  sto;
    1035 }
    1036 
     1035  array[0] =  scale * array[1];
     1036  array[1] =  scale * array[2];
     1037  array[2] =  scale * sto;
     1038}
     1039
Note: See TracChangeset for help on using the changeset viewer.