Changeset 10174 in orxonox.OLD for branches/mount_points
- Timestamp:
- Jan 3, 2007, 5:25:07 PM (18 years ago)
- Location:
- branches/mount_points/src/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mount_points/src/lib/graphics/importer/bsp/bsp_manager.cc
r10166 r10174 304 304 // bubble sort 305 305 bool hasSwapped = true; 306 Vector v1, v2; 307 306 308 while( hasSwapped) 307 309 { … … 313 315 face& fac2 = (this->bspFile->faces)[this->trasparent[i+1]]; 314 316 315 if(1) 317 // get center of face 1 318 const BspVertex* curVertex = (BspVertex *) this->bspFile->vertice; 319 320 // assign the values of the vertices 321 v1(curVertex[fac1.vertex].position[0], curVertex[fac1.vertex].position[1], curVertex[fac1.vertex].position[2]); 322 v2(curVertex[fac2.vertex].position[0], curVertex[fac2.vertex].position[1], curVertex[fac2.vertex].position[2]); 323 // relativly to observer 324 v1 = this->cam - v1; 325 v2 = this->cam - v2; 326 327 // swap if necessary 328 if( v1 < v2) 316 329 { 317 330 // swap elements … … 324 337 } 325 338 } 326 327 // function bubble_sort(list L, number listsize)328 // loop329 // has_swapped := 0 //reset flag330 // for number i from 1 to (listsize - 1)331 // if L[i] > L[i + 1] //if they are in the wrong order332 // swap(L[i], L[i + 1]) //exchange them333 // has_swapped := 1 //we have swapped at least once, list may not be sorted yet334 // endif335 // endfor336 // //if no swaps were made during this pass, the list has been sorted337 // if has_swapped = 0338 // exit339 // endif340 // endloop341 // endfunction342 339 343 340 -
branches/mount_points/src/lib/math/vector.h
r9110 r10174 47 47 /** @param v: the Vecor to compare with this one @returns true, if the Vecors are different, false otherwise */ 48 48 inline bool operator!= (const Vector& v) const { return (this->x!=v.x||this->y!=v.y||this->z!=v.z)?true:false; }; 49 inline bool operator> (const Vector& v) { return (this->len() > v.len()); } 50 inline bool operator< (const Vector& v) { return (this->len() < v.len()); } 51 49 52 /** @param index The index of the "array" @returns the x/y/z coordinate */ 50 53 inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; } … … 82 85 inline const Vector& operator= (const sVec3D& v) { this->x = v[0]; this->y = v[1]; this->z = v[2]; return *this; } 83 86 inline const Vector& operator= (const float* v) { this->x = v[0]; this->y = v[1]; this->z = v[2]; return *this; } 87 88 /** this operator can be used to assign values to the vector */ 89 inline void operator() (float x, float y, float z) { this->x = x; this->y = y; this->z = z;} 90 91 92 93 84 94 /** @param v: the other vector \return the dot product of the vectors */ 85 95 float dot (const Vector& v) const { return x*v.x+y*v.y+z*v.z; };
Note: See TracChangeset
for help on using the changeset viewer.