Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10455 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Jan 28, 2007, 7:01:41 PM (18 years ago)
Author:
patrick
Message:

scroller und debug

Location:
trunk/src/world_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/mount_point.cc

    r10440 r10455  
    3636MountPoint::MountPoint (const Vector& up, const Vector& forward, const Vector& center, const std::string& name)
    3737{
    38   PRINTF(5)("Created mount point %s\n", name.c_str());
     38  PRINTF(0)("Created mount point %s\n", name.c_str());
    3939  this->registerObject(this, MountPoint::_objectList);
    4040
  • trunk/src/world_entities/scrolling_screen.cc

    r10453 r10455  
    8888
    8989  LoadParam(root, "setSize", this, ScrollingScreen, setSize);
     90
     91  LoadParam(root, "texture", this, ScrollingScreen, setTexture);
     92}
     93
     94
     95
     96
     97/**
     98 * sets the texture
     99 * @param texture name of tex
     100 */
     101void ScrollingScreen::setTexture(const std::string& texture)
     102{
     103  this->material->setDiffuseMap( texture);
    90104}
    91105
     
    113127
    114128  glTexCoord2f(0., 0.);
    115   glVertex3f(0., -this->xSize, -this->ySize);
     129  glVertex3f(0., -this->xSize*0.5, -this->ySize*0.5);
    116130
    117 //   glTexCoord2f();
    118   glVertex3f(0., -this->xSize, -this->ySize);
     131  glTexCoord2f(0., 1.);
     132  glVertex3f(0., -this->xSize*0.5, this->ySize*0.5);
    119133
    120 //   glTexCoord2f();
    121   glVertex3f(0., -this->xSize, -this->ySize);
     134  glTexCoord2f(1., 1.);
     135  glVertex3f(0., this->xSize*0.5, this->ySize*0.5);
    122136
    123 //   glTexCoord2f();
    124   glVertex3f(0., -this->xSize, -this->ySize);
     137  glTexCoord2f(1., 0.);
     138  glVertex3f(0., this->xSize*0.5, -this->ySize*0.5);
    125139
    126140  glEnd();
     
    135149void ScrollingScreen::tick (float time)
    136150{
     151  if( State::getCameraNode() != NULL && State::getCameraTargetNode() != NULL)
     152  {
     153    PNode* cam = State::getCameraNode();
     154    PNode* tar = State::getCameraTargetNode();
    137155
     156    Vector dir = tar->getAbsCoor() - cam->getAbsCoor();
     157    dir.normalize();
     158
     159    float offset = 4.;
     160
     161    this->setAbsCoor( cam->getAbsCoor() + dir * offset);
     162
     163
     164
     165
     166//     if( this->getParent() != cam)
     167//     {
     168//       this->setParent( cam);
     169//       this->setRelCoor( 4.0, 0., 0.);
     170//       this->setRelDir();
     171//     }
     172
     173  }
    138174}
    139175
  • trunk/src/world_entities/scrolling_screen.h

    r10453 r10455  
    2525  void fadeOut(float speed);
    2626
     27  void setTexture(const std::string& texture);
     28
    2729  void setSpeed(float speed) { this->scrollingSpeed = speed; }
    2830  void setViewHeight(float height) { this->viewHeight = height; }
Note: See TracChangeset for help on using the changeset viewer.