- Timestamp:
- May 24, 2006, 2:33:45 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/graphics/importer/bsp_file.cc
r7801 r7805 288 288 289 289 PRINTF(0)("BSP FILE:NumberOfPatches: %i . \n", numPatches); 290 291 this->swapAllBspCoordinates(); 292 290 293 // Do tesselation for all Faces of type 2 291 294 for( int i = 0; i < this->numFaces; i++) { … … 301 304 return -1; 302 305 } 306 307 303 308 304 309 } … … 978 983 void BspFile::swapAllBspCoordinates() 979 984 { 985 for(int i = 0; i < this->numVertex ; ++i) 986 { 987 this->swapCoords(&((BspVertex *)this->vertice)[i].position[0]); 988 this->swapCoords(&((BspVertex *)this->vertice)[i].normal[0]); 989 990 991 } 980 992 981 } 982 983 void BspFile::swapCoords((int *) array) 984 { 993 for(int i = 0; i < this->numLeafs ; ++i) 994 { 995 this->swapCoords(this->leaves[i].mins); 996 this->swapCoords(this->leaves[i].maxs); 985 997 986 } 987 988 void BspFile::swapCoords((float *) array) 989 { 998 } 990 999 991 } 992 1000 for(int i = 0; i < this->numPlanes; ++i) 1001 { 1002 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].z = sto; 1006 } 1007 1008 1009 for(int i = 0; i < this->numFaces; ++i) 1010 { 1011 this->swapCoords(this->faces[i].normal); 1012 } 1013 1014 1015 1016 1017 1018 } 1019 1020 void BspFile::swapCoords(int *array) 1021 { 1022 int sto = array[0]; 1023 array[0] = array[1]; 1024 array[1] = array[2]; 1025 array[2] = sto; 1026 1027 } 1028 1029 void BspFile::swapCoords(float * array) 1030 { 1031 float sto = array[0]; 1032 array[0] = array[1]; 1033 array[1] = array[2]; 1034 array[2] = sto; 1035 } 1036
Note: See TracChangeset
for help on using the changeset viewer.