- Timestamp:
- Feb 22, 2005, 6:26:03 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.am
r3396 r3419 37 37 matrix.cc \ 38 38 curve.cc \ 39 glmenu_imagescreen.cc 39 glmenu_imagescreen.cc \ 40 skysphere.cc 40 41 41 42 … … 79 80 curve.h \ 80 81 glmenu_imagescreen.h \ 81 debug.h 82 debug.h \ 83 skysphere.h 82 84 83 85 -
orxonox/trunk/src/Makefile.in
r3396 r3419 64 64 base_object.$(OBJEXT) helper_parent.$(OBJEXT) \ 65 65 track_manager.$(OBJEXT) matrix.$(OBJEXT) curve.$(OBJEXT) \ 66 glmenu_imagescreen.$(OBJEXT) 66 glmenu_imagescreen.$(OBJEXT) skysphere.$(OBJEXT) 67 67 orxonox_OBJECTS = $(am_orxonox_OBJECTS) 68 68 orxonox_LDADD = $(LDADD) … … 85 85 @AMDEP_TRUE@ ./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/objModel.Po \ 86 86 @AMDEP_TRUE@ ./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/p_node.Po \ 87 @AMDEP_TRUE@ ./$(DEPDIR)/player.Po ./$(DEPDIR)/story_entity.Po \ 88 @AMDEP_TRUE@ ./$(DEPDIR)/texture.Po ./$(DEPDIR)/track.Po \ 89 @AMDEP_TRUE@ ./$(DEPDIR)/track_manager.Po ./$(DEPDIR)/vector.Po \ 90 @AMDEP_TRUE@ ./$(DEPDIR)/world.Po ./$(DEPDIR)/world_entity.Po 87 @AMDEP_TRUE@ ./$(DEPDIR)/player.Po ./$(DEPDIR)/skysphere.Po \ 88 @AMDEP_TRUE@ ./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/texture.Po \ 89 @AMDEP_TRUE@ ./$(DEPDIR)/track.Po ./$(DEPDIR)/track_manager.Po \ 90 @AMDEP_TRUE@ ./$(DEPDIR)/vector.Po ./$(DEPDIR)/world.Po \ 91 @AMDEP_TRUE@ ./$(DEPDIR)/world_entity.Po 91 92 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 92 93 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) … … 238 239 matrix.cc \ 239 240 curve.cc \ 240 glmenu_imagescreen.cc 241 glmenu_imagescreen.cc \ 242 skysphere.cc 241 243 242 244 noinst_HEADERS = ability.h \ … … 279 281 curve.h \ 280 282 glmenu_imagescreen.h \ 281 debug.h 283 debug.h \ 284 skysphere.h 282 285 283 286 EXTRA_DIST = orxonox.conf … … 384 387 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_node.Po@am__quote@ 385 388 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@ 389 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/skysphere.Po@am__quote@ 386 390 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/story_entity.Po@am__quote@ 387 391 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@ -
orxonox/trunk/src/skysphere.cc
r3416 r3419 34 34 /** 35 35 \brief Standart Constructor 36 \todo second Constructor with char* input for different skies37 36 */ 38 37 Skysphere::Skysphere() 39 38 { 40 //GLUquadricObj *sphereObj=0; 41 sphereObj=gluNewQuadric(); 42 gluQuadricTexture(sphereObj,GL_TRUE); 43 sky = new Material("Sky"); 44 sky->setDiffuseMap("../data/pictures/sky-replace.jpg"); 45 sky->setIllum(3); 46 // sky->setAmbient(1,1,1); 39 initialize("../data/pictures/sky-replace.jpg"); 40 } 47 41 42 /** 43 \brief Constructs a SkySphere and takes fileName as a map. 44 \param fileName the file to take as input for the skysphere 45 */ 46 Skysphere::Skysphere(char* fileName) 47 { 48 initialize(fileName); 48 49 } 49 50 … … 53 54 Skysphere::~Skysphere() 54 55 { 55 delete sky; 56 delete sphereObj; 56 delete sky; 57 free(sphereObj); 58 } 57 59 60 /** 61 \brief initializes the Skysphere. 62 \param fileName the file to take as input for the skysphere 63 */ 64 void Skysphere::initialize(char* fileName) 65 { 66 sphereObj=gluNewQuadric(); 67 gluQuadricTexture(sphereObj,GL_TRUE); 68 sky = new Material("Sky"); 69 sky->setDiffuseMap(fileName); 70 sky->setIllum(3); 71 sky->setAmbient(.5, .5, 1.0); 58 72 } 59 73 … … 63 77 \param y the y-coordinate of the Center of the Sphere 64 78 \param z the z-coordinate of the Center of the Sphere 65 79 66 80 This is normally done in the update-phase of world, so the Skysphere is always centered at the Camera. 67 81 */ 68 void Skysphere::updatePosition( float x,float y,float z)82 void Skysphere::updatePosition(Vector sphereCenter) 69 83 { 70 this->a=x; 71 this->b=y; 72 this->c=z; 84 this->sphereCenter = sphereCenter; 73 85 } 74 86 75 87 /** 76 88 \brief draws the Skysphere 77 89 78 90 This part is normally precessed in the "Painting Phase". 79 91 */ 80 92 81 93 void Skysphere::draw() 82 94 { 83 sky->select(); 84 glPushMatrix(); 85 glTranslatef(this->a,this->b,this->c); 86 87 glRotatef(-30,1,0,0); 88 glRotatef(95.0f,0.0f,0.0f,1.0f); 89 glRotatef(-250.0f,0.0,1.0f,0.0f); 90 91 gluSphere(sphereObj,200.0f,20,20); 92 glPopMatrix(); 93 94 95 sky->select(); 96 glPushMatrix(); 97 glTranslatef(this->sphereCenter.x,this->sphereCenter.y,this->sphereCenter.z); 98 99 glRotatef(-30,1,0,0); 100 glRotatef(95.0f,0.0f,0.0f,1.0f); 101 glRotatef(-250.0f,0.0,1.0f,0.0f); 102 103 gluSphere(sphereObj,200.0f,20,20); 104 glPopMatrix(); 95 105 } 96 106 -
orxonox/trunk/src/skysphere.h
r3416 r3419 13 13 #define _SKYSPHERE_H 14 14 15 /* INCLUDES */ 16 #include "p_node.h" 15 17 16 #include "importer/material.h" 17 #include "p_node.h" 18 #include "world_entity.h" 18 /* FORWARD DEFINITION */ 19 class Material; 20 class Vector; 19 21 20 22 //! A Class to handle a SkySphere 21 23 class Skysphere: public PNode 22 24 { 23 24 25 25 private: 26 26 GLUquadricObj *sphereObj; 27 float a,b,c; //!< Parameters to hold the Position of the SkySphere 28 Material *sky; //!< A Material for the Sky 29 27 Vector sphereCenter; //!< Center of the Skysphere 28 Material *sky; //!< A Material for the Sky 30 29 31 30 public: 32 31 Skysphere(); 32 Skysphere(char* fileName); 33 33 ~Skysphere(); 34 35 36 37 38 void updatePosition(float x,float y,float z); 34 35 void updatePosition(Vector sphereCenter); 39 36 void draw(); 40 41 42 43 44 37 38 private: 39 void initialize(char* fileName); 45 40 }; 46 41 -
orxonox/trunk/src/world.cc
r3370 r3419 28 28 #include "helper_parent.h" 29 29 #include "glmenu_imagescreen.h" 30 #include "skysphere.h" 30 31 31 32 using namespace std; … … 292 293 this->localPlayer->addChild (this->localCamera); 293 294 295 // Create SkySphere 296 skySphere = new Skysphere("../data/pictures/sky-replace.jpg"); 297 294 298 /*monitor progress*/ 295 299 this->glmis->step(); … … 631 635 // draw debug coord system 632 636 glCallList (objectList); 637 638 //! \todo skysphere is a WorldEntity and should be inside of the world-entity-list. 639 skySphere->draw(); 633 640 634 641 } … … 712 719 } 713 720 721 skySphere->updatePosition(localCamera->absCoordinate); 714 722 //for( int i = 0; i < tracklen; i++) track[i].tick (seconds); 715 723 } -
orxonox/trunk/src/world.h
r3365 r3419 17 17 class PNode; 18 18 class GLMenuImageScreen; 19 class Skysphere; 19 20 20 21 //! The game environment … … 79 80 GLuint objectList; 80 81 SDL_Surface *loadImage; 82 Skysphere* skySphere; 81 83 82 84 WorldEntity* localPlayer;
Note: See TracChangeset
for help on using the changeset viewer.