Changeset 3605 in orxonox.OLD for orxonox/branches/levelloader/src/world_entities/skysphere.cc
- Timestamp:
- Mar 18, 2005, 11:52:15 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelloader/src/world_entities/skysphere.cc
r3499 r3605 24 24 */ 25 25 26 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY 27 26 28 #include "material.h" 27 29 #include "skysphere.h" … … 29 31 #include "vector.h" 30 32 #include "world_entity.h" 31 32 33 33 34 using namespace std; … … 38 39 Skysphere::Skysphere() 39 40 { 40 initialize("../data/pictures/sky-replace.jpg");41 this->initialize("../data/pictures/sky-replace.jpg"); 41 42 } 43 42 44 43 45 /** … … 47 49 Skysphere::Skysphere(char* fileName) 48 50 { 49 initialize(fileName);51 this->initialize(fileName); 50 52 } 53 51 54 52 55 /** … … 56 59 { 57 60 PRINTF(3)("Deleting the SkySphere\n"); 58 delete skyMaterial;59 free( sphereObj);61 delete this->skyMaterial; 62 free(this->sphereObj); 60 63 } 61 64 … … 69 72 this->sphereObj = gluNewQuadric(); 70 73 gluQuadricTexture(this->sphereObj, GL_TRUE); 71 this->setRadius( 250.0);74 this->setRadius(1900.0); 72 75 73 76 this->skyMaterial = new Material("Sky"); … … 75 78 this->skyMaterial->setIllum(3); 76 79 this->skyMaterial->setAmbient(1.0, 1.0, 1.0); 77 }78 79 80 /**81 \brief sets the Radius of the Sphere.82 \param radius The Radius of The Sphere83 */84 void Skysphere::setRadius(float radius)85 {86 this->sphereRadius = radius;87 80 } 88 81 … … 99 92 100 93 /** 101 \brief updates the position of the Skysphere102 \param sphereCenter The coordinate of the Center of the Sphere103 104 This is normally done in the update-phase of world, so the Skysphere is always centered at the Camera.105 */106 void Skysphere::updatePosition(Vector sphereCenter)107 {108 this->sphereCenter = sphereCenter;109 }110 111 112 /**113 94 \brief draws the Skysphere 114 95 … … 117 98 void Skysphere::draw() 118 99 { 119 glEnable(GL_TEXTURE_2D); 100 glPushMatrix(); 101 glMatrixMode(GL_MODELVIEW); 102 glTranslatef(this->absCoordinate.x, 103 this->absCoordinate.y, 104 this->absCoordinate.z); 105 106 //glRotatef(-30, 1, 0, 0); 107 //glRotatef(95.0f, 0.0f, 0.0f, 1.0f); 108 //glRotatef(-250.0f, 0.0, 1.0f, 0.0f); 109 120 110 skyMaterial->select(); 121 glPushMatrix(); 122 glTranslatef(this->sphereCenter.x,this->sphereCenter.y,this->sphereCenter.z); 123 124 glRotatef(-30, 1, 0, 0); 125 glRotatef(95.0f, 0.0f, 0.0f, 1.0f); 126 glRotatef(-250.0f, 0.0, 1.0f, 0.0f); 127 128 gluSphere(sphereObj, sphereRadius, 20, 20); 111 gluSphere(this->sphereObj, this->sphereRadius, 20, 20); 129 112 glPopMatrix(); 130 glDisable(GL_TEXTURE_2D);131 113 } 114 115 116 /** 117 \brief sets the Radius of the Sphere. 118 \param radius The Radius of The Sphere 119 */ 120 void Skysphere::setRadius(float radius) 121 { 122 this->sphereRadius = radius; 123 }
Note: See TracChangeset
for help on using the changeset viewer.