Changeset 4824 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jul 8, 2005, 1:24:12 PM (20 years ago)
- Location:
- orxonox/trunk/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/player.cc
r4822 r4824 33 33 #include "event.h" 34 34 35 #include "crosshair.h"36 37 38 35 39 36 using namespace std; … … 76 73 */ 77 74 delete this->weaponMan; 78 delete this->crosshair;79 75 } 80 76 … … 100 96 this->weaponMan->addWeapon(wpRight, W_CONFIG2); 101 97 this->weaponMan->addWeapon(wpLeft, W_CONFIG2); 102 103 104 this->crosshair = new Crosshair();105 98 } 106 99 … … 198 191 void Player::draw () 199 192 { 200 this->crosshair->draw();201 193 glMatrixMode(GL_MODELVIEW); 202 194 glPushMatrix(); -
orxonox/trunk/src/world_entities/weapons/crosshair.cc
r4823 r4824 115 115 GraphicsEngine::storeMatrices(); 116 116 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 118 122 GLdouble objX, objY, objZ; 119 123 if (gluUnProject(position2D[0], 120 124 GraphicsEngine::getInstance()->getResolutionY()-position2D[1], 121 .8,125 z, 122 126 GraphicsEngine::modMat, 123 127 GraphicsEngine::projMat, … … 126 130 &objY, 127 131 &objZ )); 128 132 /* 129 133 glBegin(GL_TRIANGLES); 130 134 glColor3f(1,0,0); … … 133 137 glVertex3f(objX, objY, objZ+1); 134 138 glEnd(); 139 */ 135 140 }
Note: See TracChangeset
for help on using the changeset viewer.