Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4824 in orxonox.OLD


Ignore:
Timestamp:
Jul 8, 2005, 1:24:12 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: cleaned out the crosshair of the Player

Location:
orxonox/trunk/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/player.cc

    r4822 r4824  
    3333#include "event.h"
    3434
    35 #include "crosshair.h"
    36 
    37 
    3835
    3936using namespace std;
     
    7673  */
    7774  delete this->weaponMan;
    78   delete this->crosshair;
    7975}
    8076
     
    10096  this->weaponMan->addWeapon(wpRight, W_CONFIG2);
    10197  this->weaponMan->addWeapon(wpLeft, W_CONFIG2);
    102 
    103 
    104   this->crosshair = new Crosshair();
    10598}
    10699
     
    198191void Player::draw ()
    199192{
    200   this->crosshair->draw();
    201193  glMatrixMode(GL_MODELVIEW);
    202194  glPushMatrix();
  • orxonox/trunk/src/world_entities/weapons/crosshair.cc

    r4823 r4824  
    115115  GraphicsEngine::storeMatrices();
    116116
    117   GLdouble z;
     117  GLfloat z;
     118  glReadPixels ((int)position2D[0], GraphicsEngine::getInstance()->getResolutionY()-(int)position2D[1], 1, 1, GL_DEPTH_COMPONENT, GL_DOUBLE, &z);
     119
     120  printf("%p:: %d %d %f\n",this, (int)position2D[0], (int)position2D[1], z);
     121
    118122  GLdouble objX, objY, objZ;
    119123  if (gluUnProject(position2D[0],
    120124      GraphicsEngine::getInstance()->getResolutionY()-position2D[1],
    121       .8,
     125      z,
    122126      GraphicsEngine::modMat,
    123127      GraphicsEngine::projMat,
     
    126130      &objY,
    127131      &objZ ));
    128 
     132  /*
    129133  glBegin(GL_TRIANGLES);
    130134  glColor3f(1,0,0);
     
    133137  glVertex3f(objX, objY, objZ+1);
    134138  glEnd();
     139  */
    135140}
Note: See TracChangeset for help on using the changeset viewer.