Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3675 in orxonox.OLD


Ignore:
Timestamp:
Mar 30, 2005, 5:20:21 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: glmenu progressbar corrected, pnode modifications

Location:
orxonox/trunk/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/camera.cc

    r3645 r3675  
    139139  if (tmpFovy > .001)
    140140    this->fovy += (this->toFovy - this->fovy) * dt;
    141   Vector tmpPos = (this->toRelCoor - this->getRelCoor()) * dt;
     141  Vector tmpPos = (this->toRelCoor - *this->getRelCoor()) * dt;
    142142  if (tmpPos.len() >= .001)
    143143    {
    144       tmpPos = tmpPos + this->getRelCoor();
     144      tmpPos = tmpPos + *this->getRelCoor();
    145145      this->setRelCoor(&tmpPos);
    146146    }
  • orxonox/trunk/src/glmenu/glmenu_imagescreen.cc

    r3658 r3675  
    110110void GLMenuImageScreen::draw ()
    111111{
    112   /*
    113   // Display a quad texture to the screen
    114   glEnable(GL_TEXTURE_2D);
    115   glBegin(GL_QUADS);
    116  
    117   // Display the top left vertice
    118   glTexCoord2f(0.0f, 1.0f);
    119   glVertex3f(-2.5, 2.5, 0);
    120  
    121   // Display the bottom left vertice
    122   glTexCoord2f(0.0f, 0.0f);
    123   glVertex3f(-2.5, -2.5, 0);
    124  
    125   // Display the bottom right vertice
    126   glTexCoord2f(1.0f, 0.0f);
    127   glVertex3f(2.5, -2.5, 0);
    128  
    129   // Display the top right vertice
    130   glTexCoord2f(1.0f, 1.0f);
    131   glVertex3f(2.5, 2.5, 0);
    132 
    133   glEnd();
    134   glEnable(GL_TEXTURE_2D); 
    135   */
    136112
    137113  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);
    138119
    139120  /* screen size */
     
    154135  int barWidth = 230;
    155136  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;
    158141
    159142  glMatrixMode(GL_PROJECTION);
     
    170153  glDisable(GL_LIGHTING);
    171154
     155  /* draw the progress bar */
    172156  glBegin(GL_QUADS);
    173157  glColor3f(0.96, 0.84, 0.34);
    174158  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);
    177161  glVertex2i(barX, barY + barHeight);
    178162  glColor3f(1.0, 1.0, 1.0);
     
    223207  glPopAttrib();
    224208
    225   SDL_GL_SwapBuffers();                   
     209  SDL_GL_SwapBuffers();             
    226210}
    227211 
  • orxonox/trunk/src/glmenu/glmenu_imagescreen.h

    r3544 r3675  
    4545  float offsetX, offsetY;    //!< offset of the image from left and up
    4646  Material* backMat;         //!< Background Material.
     47
     48  /* progress bar values */
    4749  int currentValue;          //!< the current count of step() calls fired yet
    4850  int maxValue;              //!< total count of steps
  • orxonox/trunk/src/lib/coord/p_node.cc

    r3669 r3675  
    142142   \brief get relative coordinates
    143143   \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*/
     148Vector* PNode::getRelCoor ()
     149{
     150  //Vector r = *this->relCoordinate; /* return a copy, so it can't be modified */
     151  return this->relCoordinate;
    149152}
    150153
     
    166169
    167170/**
     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*/
     178void PNode::setRelCoor (Vector relCoord)
     179{
     180  this->bRelCoorChanged = true;
     181  *this->relCoordinate = relCoord;
     182}
     183
     184
     185/**
    168186   \brief get absolute coordinates
    169187   \returns absolute coordinates from (0,0,0)
     
    186204  this->bAbsCoorChanged = true;
    187205  *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*/
     217void PNode::setAbsCoor (Vector absCoord)
     218{
     219  this->bAbsCoorChanged = true;
     220  *this->absCoordinate = absCoord;
    188221}
    189222
     
    249282
    250283
     284void PNode::setRelDir (Quaternion relDir)
     285{
     286  this->bRelCoorChanged = true;
     287  *this->relDirection = relDir;
     288}
     289
     290
    251291/**
    252292   \brief gets the absolute direction (0,0,1)
     
    272312  *this->absDirection = *absDir;
    273313}
     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*/
     325void PNode::setAbsDir (Quaternion absDir)
     326{
     327  this->bAbsDirChanged = true;
     328  *this->absDirection = absDir;
     329}
     330
    274331
    275332
  • orxonox/trunk/src/lib/coord/p_node.h

    r3644 r3675  
    5757
    5858
    59   Vector getRelCoor ();
     59  Vector* getRelCoor ();
    6060  void setRelCoor (Vector* relCoord);
    61   //void setRelCoor (Vector relCoord);
     61  void setRelCoor (Vector relCoord);
    6262  Vector getAbsCoor ();
    6363  void setAbsCoor (Vector* absCoord);
    64   //void setAbsCoor (Vector absCoord);
     64  void setAbsCoor (Vector absCoord);
    6565  void shiftCoor (Vector* shift);
    6666  //void shiftCoor (Vector shift);
     
    6868  Quaternion getRelDir ();
    6969  void setRelDir (Quaternion* relDir);
     70  void setRelDir (Quaternion relDir);
    7071  Quaternion getAbsDir ();
    7172  void setAbsDir (Quaternion* absDir);
     73  void setAbsDir (Quaternion absDir);
    7274  void shiftDir (Quaternion* shift);
    7375
  • orxonox/trunk/src/story_entities/world.cc

    r3672 r3675  
    201201      testFont = new FontSet();
    202202      testFont->buildFont("../data/pictures/font.tga");
     203      this->glmis->step();
    203204
    204205      // initializing the TrackManager
     
    299300            this->spawn (this->localPlayer);
    300301            /*monitor progress*/
    301             this->glmis->step();           
     302            //this->glmis->step();         
     303            this->glmis->step();
    302304
    303305            // bind input
     
    312314           
    313315            /*monitor progress*/
    314             this->glmis->step();           
     316            this->glmis->step();
    315317
    316318            // Create SkySphere
     
    350352            //Vector* cameraOffset = new Vector (0, 5, -10);
    351353            trackManager->condition(2, LEFTRIGHT, this->localPlayer);
     354            this->glmis->step();
    352355
    353356            break;
     
    485488  this->glmis = GLMenuImageScreen::getInstance();
    486489  this->glmis->init();
    487   this->glmis->setMaximum(10);
     490  this->glmis->setMaximum(8);
    488491  this->glmis->draw();
    489492 
     
    500503  PRINTF(3)("World::releaseLoadScreen - start\n");
    501504  this->glmis->setValue(this->glmis->getMaximum());
    502   SDL_Delay(500);
     505  //SDL_Delay(500);
    503506  PRINTF(3)("World::releaseLoadScreen - end\n");
    504507}
  • orxonox/trunk/src/track_manager.cc

    r3661 r3675  
    268268  PNode* tmpNode = (PNode*)node;
    269269
    270   if (tmpNode->getRelCoor().z < 0)
     270  if (tmpNode->getRelCoor()->z < 0)
    271271    return 0;
    272272  else
     
    289289  PNode* tmpNode = (PNode*)node;
    290290
    291   Vector nodeRelCoord = tmpNode->getRelCoor();
     291  Vector nodeRelCoord = *tmpNode->getRelCoor();
    292292  float minDist = 100000000;
    293293  int childNumber = 0;
  • orxonox/trunk/src/world_entities/player.cc

    r3672 r3675  
    178178  //orthDirection = orthDirection.cross (direction);
    179179
    180   if( this->bUp && this->getRelCoor().x < 20)
     180  if( this->bUp && this->getRelCoor()->x < 20)
    181181    accel = accel+(direction*acceleration);
    182   if( this->bDown && this->getRelCoor().x > -5)
     182  if( this->bDown && this->getRelCoor()->x > -5)
    183183    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)
    185185    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)
    187187    accel = accel + (orthDirection*acceleration);
    188188  if( this->bAscend )
  • orxonox/trunk/src/world_entities/projectile.cc

    r3672 r3675  
    101101  if( this->ttl < this->currentLifeTime)
    102102    {
    103       *this->flightDirection = *this->flightDirection * this->speed;
     103      *this->flightDirection = *this->flightDirection * this->speed * time;
    104104      this->shiftCoor(this->flightDirection);
    105105      this->flightDirection->debug();
  • orxonox/trunk/src/world_entities/test_gun.cc

    r3670 r3675  
    8484  //printf("TestGun::fire() - firing weapon now ---------------------------\n");
    8585  Projectile* pj = new Projectile();
     86
    8687  Vector* v = new Vector();
    8788  *v = this->getAbsCoor();
     
    9394  pj->setFlightDirection(q);
    9495  //pj->setSpeed(this->getSpeed() * 0.025);
     96
    9597
    9698
Note: See TracChangeset for help on using the changeset viewer.