- Timestamp:
- Mar 30, 2005, 5:20:21 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/camera.cc
r3645 r3675 139 139 if (tmpFovy > .001) 140 140 this->fovy += (this->toFovy - this->fovy) * dt; 141 Vector tmpPos = (this->toRelCoor - this->getRelCoor()) * dt;141 Vector tmpPos = (this->toRelCoor - *this->getRelCoor()) * dt; 142 142 if (tmpPos.len() >= .001) 143 143 { 144 tmpPos = tmpPos + this->getRelCoor();144 tmpPos = tmpPos + *this->getRelCoor(); 145 145 this->setRelCoor(&tmpPos); 146 146 } -
orxonox/trunk/src/glmenu/glmenu_imagescreen.cc
r3658 r3675 110 110 void GLMenuImageScreen::draw () 111 111 { 112 /*113 // Display a quad texture to the screen114 glEnable(GL_TEXTURE_2D);115 glBegin(GL_QUADS);116 117 // Display the top left vertice118 glTexCoord2f(0.0f, 1.0f);119 glVertex3f(-2.5, 2.5, 0);120 121 // Display the bottom left vertice122 glTexCoord2f(0.0f, 0.0f);123 glVertex3f(-2.5, -2.5, 0);124 125 // Display the bottom right vertice126 glTexCoord2f(1.0f, 0.0f);127 glVertex3f(2.5, -2.5, 0);128 129 // Display the top right vertice130 glTexCoord2f(1.0f, 1.0f);131 glVertex3f(2.5, 2.5, 0);132 133 glEnd();134 glEnable(GL_TEXTURE_2D);135 */136 112 137 113 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 114 115 116 //PRINTF()(); 117 printf("GLMenuImagEscreen::draw() - drawing step %i/%i\n", 118 this->currentValue, this->maxValue); 138 119 139 120 /* screen size */ … … 154 135 int barWidth = 230; 155 136 int barHeight = 30; 156 157 int val = (int)((float)this->currentValue/(float)this->maxValue) * barWidth; 137 138 float val = ((float)this->currentValue/(float)this->maxValue) * barWidth; 139 if( val > (float)barWidth) 140 val = (float)barWidth; 158 141 159 142 glMatrixMode(GL_PROJECTION); … … 170 153 glDisable(GL_LIGHTING); 171 154 155 /* draw the progress bar */ 172 156 glBegin(GL_QUADS); 173 157 glColor3f(0.96, 0.84, 0.34); 174 158 glVertex2i(barX, barY); 175 glVertex2i(barX + val, barY);176 glVertex2i(barX + val, barY + barHeight);159 glVertex2i(barX + (int)val, barY); 160 glVertex2i(barX + (int)val, barY + barHeight); 177 161 glVertex2i(barX, barY + barHeight); 178 162 glColor3f(1.0, 1.0, 1.0); … … 223 207 glPopAttrib(); 224 208 225 SDL_GL_SwapBuffers(); 209 SDL_GL_SwapBuffers(); 226 210 } 227 211 -
orxonox/trunk/src/glmenu/glmenu_imagescreen.h
r3544 r3675 45 45 float offsetX, offsetY; //!< offset of the image from left and up 46 46 Material* backMat; //!< Background Material. 47 48 /* progress bar values */ 47 49 int currentValue; //!< the current count of step() calls fired yet 48 50 int maxValue; //!< total count of steps -
orxonox/trunk/src/lib/coord/p_node.cc
r3669 r3675 142 142 \brief get relative coordinates 143 143 \returns relative coordinates to its parent 144 */ 145 Vector PNode::getRelCoor () 146 { 147 Vector r = *this->relCoordinate; /* return a copy, so it can't be modified */ 148 return r; 144 145 the reference that is returned is a pointer to the real relCoor, so don't 146 change it unless you realy know what you are doing. 147 */ 148 Vector* PNode::getRelCoor () 149 { 150 //Vector r = *this->relCoordinate; /* return a copy, so it can't be modified */ 151 return this->relCoordinate; 149 152 } 150 153 … … 166 169 167 170 /** 171 \brief set relative coordinates 172 \param relCoord relative coordinates to its parent 173 174 it is very importand, that you use this function, if you want to update the 175 relCoordinates. If you don't use this, the PNode won't recognize, that something 176 has changed and won't update the children Nodes. 177 */ 178 void PNode::setRelCoor (Vector relCoord) 179 { 180 this->bRelCoorChanged = true; 181 *this->relCoordinate = relCoord; 182 } 183 184 185 /** 168 186 \brief get absolute coordinates 169 187 \returns absolute coordinates from (0,0,0) … … 186 204 this->bAbsCoorChanged = true; 187 205 *this->absCoordinate = *absCoord; 206 } 207 208 209 210 /** 211 \param absCoord set absolute coordinate 212 213 it is very importand, that you use this function, if you want to update the 214 absCoordinates. If you don't use this, the PNode won't recognize, that something 215 has changed and won't update the children Nodes. 216 */ 217 void PNode::setAbsCoor (Vector absCoord) 218 { 219 this->bAbsCoorChanged = true; 220 *this->absCoordinate = absCoord; 188 221 } 189 222 … … 249 282 250 283 284 void PNode::setRelDir (Quaternion relDir) 285 { 286 this->bRelCoorChanged = true; 287 *this->relDirection = relDir; 288 } 289 290 251 291 /** 252 292 \brief gets the absolute direction (0,0,1) … … 272 312 *this->absDirection = *absDir; 273 313 } 314 315 316 317 /** 318 \brief sets the absolute direction (0,0,1) 319 \param absDir absolute coordinates 320 321 it is very importand, that you use this function, if you want to update the 322 absDirection. If you don't use this, the PNode won't recognize, that something 323 has changed and won't update the children Nodes. 324 */ 325 void PNode::setAbsDir (Quaternion absDir) 326 { 327 this->bAbsDirChanged = true; 328 *this->absDirection = absDir; 329 } 330 274 331 275 332 -
orxonox/trunk/src/lib/coord/p_node.h
r3644 r3675 57 57 58 58 59 Vector getRelCoor ();59 Vector* getRelCoor (); 60 60 void setRelCoor (Vector* relCoord); 61 //void setRelCoor (Vector relCoord);61 void setRelCoor (Vector relCoord); 62 62 Vector getAbsCoor (); 63 63 void setAbsCoor (Vector* absCoord); 64 //void setAbsCoor (Vector absCoord);64 void setAbsCoor (Vector absCoord); 65 65 void shiftCoor (Vector* shift); 66 66 //void shiftCoor (Vector shift); … … 68 68 Quaternion getRelDir (); 69 69 void setRelDir (Quaternion* relDir); 70 void setRelDir (Quaternion relDir); 70 71 Quaternion getAbsDir (); 71 72 void setAbsDir (Quaternion* absDir); 73 void setAbsDir (Quaternion absDir); 72 74 void shiftDir (Quaternion* shift); 73 75 -
orxonox/trunk/src/story_entities/world.cc
r3672 r3675 201 201 testFont = new FontSet(); 202 202 testFont->buildFont("../data/pictures/font.tga"); 203 this->glmis->step(); 203 204 204 205 // initializing the TrackManager … … 299 300 this->spawn (this->localPlayer); 300 301 /*monitor progress*/ 301 this->glmis->step(); 302 //this->glmis->step(); 303 this->glmis->step(); 302 304 303 305 // bind input … … 312 314 313 315 /*monitor progress*/ 314 this->glmis->step(); 316 this->glmis->step(); 315 317 316 318 // Create SkySphere … … 350 352 //Vector* cameraOffset = new Vector (0, 5, -10); 351 353 trackManager->condition(2, LEFTRIGHT, this->localPlayer); 354 this->glmis->step(); 352 355 353 356 break; … … 485 488 this->glmis = GLMenuImageScreen::getInstance(); 486 489 this->glmis->init(); 487 this->glmis->setMaximum( 10);490 this->glmis->setMaximum(8); 488 491 this->glmis->draw(); 489 492 … … 500 503 PRINTF(3)("World::releaseLoadScreen - start\n"); 501 504 this->glmis->setValue(this->glmis->getMaximum()); 502 SDL_Delay(500);505 //SDL_Delay(500); 503 506 PRINTF(3)("World::releaseLoadScreen - end\n"); 504 507 } -
orxonox/trunk/src/track_manager.cc
r3661 r3675 268 268 PNode* tmpNode = (PNode*)node; 269 269 270 if (tmpNode->getRelCoor() .z < 0)270 if (tmpNode->getRelCoor()->z < 0) 271 271 return 0; 272 272 else … … 289 289 PNode* tmpNode = (PNode*)node; 290 290 291 Vector nodeRelCoord = tmpNode->getRelCoor();291 Vector nodeRelCoord = *tmpNode->getRelCoor(); 292 292 float minDist = 100000000; 293 293 int childNumber = 0; -
orxonox/trunk/src/world_entities/player.cc
r3672 r3675 178 178 //orthDirection = orthDirection.cross (direction); 179 179 180 if( this->bUp && this->getRelCoor() .x < 20)180 if( this->bUp && this->getRelCoor()->x < 20) 181 181 accel = accel+(direction*acceleration); 182 if( this->bDown && this->getRelCoor() .x > -5)182 if( this->bDown && this->getRelCoor()->x > -5) 183 183 accel = accel-(direction*acceleration); 184 if( this->bLeft && TrackManager::getInstance()->getWidth() > -this->getRelCoor() .z*2)184 if( this->bLeft && TrackManager::getInstance()->getWidth() > -this->getRelCoor()->z*2) 185 185 accel = accel - (orthDirection*acceleration); 186 if( this->bRight && TrackManager::getInstance()->getWidth() > this->getRelCoor() .z*2)186 if( this->bRight && TrackManager::getInstance()->getWidth() > this->getRelCoor()->z*2) 187 187 accel = accel + (orthDirection*acceleration); 188 188 if( this->bAscend ) -
orxonox/trunk/src/world_entities/projectile.cc
r3672 r3675 101 101 if( this->ttl < this->currentLifeTime) 102 102 { 103 *this->flightDirection = *this->flightDirection * this->speed ;103 *this->flightDirection = *this->flightDirection * this->speed * time; 104 104 this->shiftCoor(this->flightDirection); 105 105 this->flightDirection->debug(); -
orxonox/trunk/src/world_entities/test_gun.cc
r3670 r3675 84 84 //printf("TestGun::fire() - firing weapon now ---------------------------\n"); 85 85 Projectile* pj = new Projectile(); 86 86 87 Vector* v = new Vector(); 87 88 *v = this->getAbsCoor(); … … 93 94 pj->setFlightDirection(q); 94 95 //pj->setSpeed(this->getSpeed() * 0.025); 96 95 97 96 98
Note: See TracChangeset
for help on using the changeset viewer.