- this->weaponSteigung = ((y1 - y2) / (x1 - x2));
- this->weaponRotation = atan(this->weaponSteigung) * 180 / PI;
- //writeToLogfile("weaponRotation = ", this->weaponRotation);
- /*if (this->weaponRotation > 0)
- {
- x = ((bw / 360) * this->weaponRotation) / 2;
- }
- else
- {
- x = ((bw / 360) * this->weaponRotation) / 2;
- x = x * (-1);
- }*/
- glTranslatef((player.X), (player.Y), 0);
- glRotatef(this->weaponRotation, 0, 0, 1);
- glBegin(GL_QUADS);
- glTexCoord2f(0, 1 - (5 * tbs));
- glVertex3f(((-1 * (bw / 2)) - x), ((bh / 2) - y), (player.spawnZ + player.Z));
- glTexCoord2f(tbs, 1 - (5 * tbs));
- glVertex3f(((bw / 2) + x), ((bh / 2) - y), (player.spawnZ + player.Z));
- glTexCoord2f(tbs, 1 - (6 * tbs));
- glVertex3f(((bw / 2) + x), ((-1 * (bh / 2)) + y), (player.spawnZ + player.Z));
- glTexCoord2f(0, 1 - (6 * tbs));
- glVertex3f(((-1 * (bw / 2)) - x), ((-1 * (bh / 2)) + y), (player.spawnZ + player.Z));
- glEnd();