Changeset 6004 in orxonox.OLD for trunk/src/world_entities/world_entity.cc
- Timestamp:
- Dec 9, 2005, 11:12:04 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/world_entity.cc
r6002 r6004 118 118 119 119 if (this->models[modelNumber] != NULL) 120 { 120 { 121 121 Resource* resource = ResourceManager::getInstance()->locateResourceByPointer(this->models[modelNumber]); 122 122 if (resource != NULL) … … 127 127 this->models[modelNumber] = model; 128 128 129 // if (this->model != NULL) 129 // if (this->model != NULL) 130 130 // this->buildObbTree(4); 131 131 } … … 233 233 glMatrixMode(GL_MODELVIEW); 234 234 glPushMatrix(); 235 float matrix[4][4];236 235 237 236 /* translate */ … … 239 238 this->getAbsCoor ().y, 240 239 this->getAbsCoor ().z); 241 /* rotate */ // FIXME: devise a new Way to rotate this 242 this->getAbsDir ().matrix (matrix); 243 glMultMatrixf((float*)matrix); 244 240 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 241 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 242 243 244 // This Draws the LOD's 245 245 float cameraDistance = (State::getCamera()->getAbsCoor() - this->getAbsCoor()).len(); 246 if (this->isA(CL_HELICOPTER)) 247 printf("Test %f %d\n", cameraDistance, this->models.size()); 248 if (cameraDistance > 100 && this->models.size() >= 3 && this->models[2] != NULL) 246 if (cameraDistance > 30 && this->models.size() >= 3 && this->models[2] != NULL) 249 247 { 250 if (this->isA(CL_HELICOPTER))printf("====== 2 ===\n");251 248 this->models[2]->draw(); 252 } 253 else if (cameraDistance > 50 && this->models.size() >= 2 && this->models[1] != NULL)249 } 250 else if (cameraDistance > 10 && this->models.size() >= 2 && this->models[1] != NULL) 254 251 { 255 if (this->isA(CL_HELICOPTER))printf("====== 1 ===\n");256 252 this->models[1]->draw(); 257 } 258 else if (this->models.size() >= 1 && this->models[0] != NULL) 253 } 254 else if (this->models.size() >= 1 && this->models[0] != NULL) 259 255 { 260 if (this->isA(CL_HELICOPTER))printf("====== 0 ===\n");261 256 this->models[0]->draw(); 262 257 }
Note: See TracChangeset
for help on using the changeset viewer.