Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5381 in orxonox.OLD for branches/2d-recalc/src/world_entities


Ignore:
Timestamp:
Oct 15, 2005, 7:13:23 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/2d-recalc: some recalculations.. do not know it i will continue with this, as has certain disadvantages over the old approach… maybe later

Location:
branches/2d-recalc/src/world_entities/weapons
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2d-recalc/src/world_entities/weapons/crosshair.cc

    r5378 r5381  
    6565  this->setLayer(E2D_TOP);
    6666  this->setRotationSpeed(5);
    67   this->setSize(GraphicsEngine::getInstance()->getResolutionX()/10.0);
     67  this->setSize(0.1);
    6868
    69   this->setBindNode(this);
     69//  this->setBindNode(this);
    7070  this->material = new Material;
    7171
     
    7373
    7474  // center the mouse on the screen, and also hide the cursors
    75   SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2);
     75//  SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2);
    7676  GraphicsEngine::showMouse(false);
    7777  GraphicsEngine::stealWMEvents(true);
     
    121121  if  (event.type == EV_MOUSE_MOTION)
    122122  {
    123     this->setAbsCoor2D(event.x, event.y);
     123    this->setAbsCoor2Dpx(event.x, event.y);
    124124  }
    125125}
     
    134134  this->shiftDir2D(dt * rotationSpeed);
    135135
    136 
    137136  float z = 0.0f;
    138   glReadPixels ((int)this->getAbsCoor2D().x,
    139                  GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1,
     137  glReadPixels ((int)this->getAbsCoor2Dpx().x,
     138                 GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2Dpx().y-1,
    140139                 1,
    141140                 1,
     
    146145
    147146  GLdouble objX=.0, objY=.0, objZ=.0;
    148   gluUnProject(this->getAbsCoor2D().x,
    149                GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1,
     147  gluUnProject(this->getAbsCoor2Dpx().x,
     148               GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2Dpx().y-1,
    150149               .99,  // z
    151150               GraphicsEngine::modMat,
     
    166165  glPushMatrix();
    167166  glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
     167//  printf("%f, %f\n", this->getAbsCoor2D().x, this->getAbsCoor2D().y);
    168168
    169169  glRotatef(this->getAbsDir2D(), 0,0,1);
  • branches/2d-recalc/src/world_entities/weapons/weapon_manager.cc

    r5208 r5381  
    106106  this->crossHairSizeAnim = new tAnimation<Crosshair>(this->crosshair, &Crosshair::setSize);
    107107  this->crossHairSizeAnim->setInfinity(ANIM_INF_REWIND);
    108   this->crossHairSizeAnim->addKeyFrame(50, .1, ANIM_LINEAR);
    109   this->crossHairSizeAnim->addKeyFrame(100, .05, ANIM_LINEAR);
    110   this->crossHairSizeAnim->addKeyFrame(50, .01, ANIM_LINEAR);
     108  this->crossHairSizeAnim->addKeyFrame(.1, .1, ANIM_LINEAR);
     109  this->crossHairSizeAnim->addKeyFrame(.2, .05, ANIM_LINEAR);
     110  this->crossHairSizeAnim->addKeyFrame(.1, .01, ANIM_LINEAR);
    111111}
    112112
Note: See TracChangeset for help on using the changeset viewer.