- Timestamp:
- Mar 1, 2005, 6:16:49 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 8 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.am
r3433 r3436 37 37 curve.cc \ 38 38 glmenu_imagescreen.cc \ 39 skysphere.cc 39 skysphere.cc \ 40 light.cc 40 41 41 42 noinst_HEADERS = ability.h \ … … 79 80 glmenu_imagescreen.h \ 80 81 debug.h \ 81 skysphere.h 82 skysphere.h \ 83 light.h 82 84 83 85 ## orxonox.conf will be used from home-dir instead. -
orxonox/trunk/src/Makefile.in
r3433 r3436 64 64 helper_parent.$(OBJEXT) track_manager.$(OBJEXT) \ 65 65 matrix.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \ 66 skysphere.$(OBJEXT) 66 skysphere.$(OBJEXT) light.$(OBJEXT) 67 67 orxonox_OBJECTS = $(am_orxonox_OBJECTS) 68 68 orxonox_LDADD = $(LDADD) … … 81 81 @AMDEP_TRUE@ ./$(DEPDIR)/helper_parent.Po \ 82 82 @AMDEP_TRUE@ ./$(DEPDIR)/ini_parser.Po ./$(DEPDIR)/keynames.Po \ 83 @AMDEP_TRUE@ ./$(DEPDIR)/list.Po ./$(DEPDIR)/material.Po \ 84 @AMDEP_TRUE@ ./$(DEPDIR)/matrix.Po ./$(DEPDIR)/model.Po \ 85 @AMDEP_TRUE@ ./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/objModel.Po \ 86 @AMDEP_TRUE@ ./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/p_node.Po \ 87 @AMDEP_TRUE@ ./$(DEPDIR)/player.Po ./$(DEPDIR)/skysphere.Po \ 83 @AMDEP_TRUE@ ./$(DEPDIR)/light.Po ./$(DEPDIR)/list.Po \ 84 @AMDEP_TRUE@ ./$(DEPDIR)/material.Po ./$(DEPDIR)/matrix.Po \ 85 @AMDEP_TRUE@ ./$(DEPDIR)/model.Po ./$(DEPDIR)/null_parent.Po \ 86 @AMDEP_TRUE@ ./$(DEPDIR)/objModel.Po ./$(DEPDIR)/orxonox.Po \ 87 @AMDEP_TRUE@ ./$(DEPDIR)/p_node.Po ./$(DEPDIR)/player.Po \ 88 @AMDEP_TRUE@ ./$(DEPDIR)/skysphere.Po \ 88 89 @AMDEP_TRUE@ ./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/texture.Po \ 89 90 @AMDEP_TRUE@ ./$(DEPDIR)/track_manager.Po ./$(DEPDIR)/vector.Po \ … … 246 247 curve.cc \ 247 248 glmenu_imagescreen.cc \ 248 skysphere.cc 249 skysphere.cc \ 250 light.cc 249 251 250 252 noinst_HEADERS = ability.h \ … … 288 290 glmenu_imagescreen.h \ 289 291 debug.h \ 290 skysphere.h 292 skysphere.h \ 293 light.h 291 294 292 295 EXTRA_DIST = orxonox.conf … … 316 319 esac; \ 317 320 done; \ 318 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/Makefile'; \321 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ 319 322 cd $(top_srcdir) && \ 320 $(AUTOMAKE) -- gnusrc/Makefile323 $(AUTOMAKE) --foreign src/Makefile 321 324 .PRECIOUS: Makefile 322 325 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status … … 384 387 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ini_parser.Po@am__quote@ 385 388 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keynames.Po@am__quote@ 389 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/light.Po@am__quote@ 386 390 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ 387 391 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@ -
orxonox/trunk/src/console/Makefile.in
r3433 r3436 203 203 esac; \ 204 204 done; \ 205 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/console/Makefile'; \205 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/console/Makefile'; \ 206 206 cd $(top_srcdir) && \ 207 $(AUTOMAKE) -- gnusrc/console/Makefile207 $(AUTOMAKE) --foreign src/console/Makefile 208 208 .PRECIOUS: Makefile 209 209 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
orxonox/trunk/src/gui/Makefile.in
r3433 r3436 234 234 esac; \ 235 235 done; \ 236 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/gui/Makefile'; \236 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/gui/Makefile'; \ 237 237 cd $(top_srcdir) && \ 238 $(AUTOMAKE) -- gnusrc/gui/Makefile238 $(AUTOMAKE) --foreign src/gui/Makefile 239 239 .PRECIOUS: Makefile 240 240 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
orxonox/trunk/src/importer/Makefile.in
r3433 r3436 215 215 esac; \ 216 216 done; \ 217 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/importer/Makefile'; \217 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/importer/Makefile'; \ 218 218 cd $(top_srcdir) && \ 219 $(AUTOMAKE) -- gnusrc/importer/Makefile219 $(AUTOMAKE) --foreign src/importer/Makefile 220 220 .PRECIOUS: Makefile 221 221 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
orxonox/trunk/src/light.cc
r3435 r3436 12 12 13 13 ### File Specific: 14 main-programmer: ...14 main-programmer: Benjamin Grauer 15 15 co-programmer: ... 16 16 */ 17 17 18 18 19 #include " proto_class.h"19 #include "light.h" 20 20 21 #include "glincl.h" 21 22 22 23 using namespace std; … … 24 25 25 26 /** 26 \brief standard constructor 27 \todo this constructor is not jet implemented - do it 27 \brief standard constructor for a Light 28 28 */ 29 ProtoClass::ProtoClass()29 Light::Light () 30 30 { 31 this->setClassName ("ProtoClass");31 this->init(); 32 32 } 33 33 34 Light::Light(Vector position) 35 { 36 this->init(); 37 this->setPosition(position); 38 } 34 39 35 40 /** … … 38 43 39 44 */ 40 ProtoClass::~ProtoClass () {} 45 Light::~Light () 46 { 47 glDisable(GL_LIGHTING); 48 glDisable(GL_LIGHT0); 49 } 50 51 /** 52 \brief initializes a new Light with default values, and enables GL_LIGHTING 53 */ 54 void Light::init() 55 { 56 this->setClassName ("Light"); 57 glEnable (GL_LIGHTING); 58 glEnable (GL_LIGHT0); 59 60 this->setPosition(Vector(0.0, 0.0, 0.0)); 61 this->setDiffuseColor(1.0, 1.0, 1.0); 62 this->setSpecularColor(1.0, 1.0, 1.0); 63 // lmodelAmbient[] = {.1, .1, .1, 1.0}; 64 65 } 66 67 // set Attributes 68 /** 69 \brief Sets a Position for the Light. 70 \param position The new position of the Light. 71 \todo patrick: is it ok to set a Light Position even if it is derived from p_node?? 72 */ 73 void Light::setPosition(Vector position) 74 { 75 this->lightPosition[0] = position.x; 76 this->lightPosition[1] = position.y; 77 this->lightPosition[2] = position.z; 78 this->lightPosition[3] = 0.0; 79 80 glLightfv (GL_LIGHT0, GL_POSITION, lightPosition); 81 82 } 83 84 /** 85 \brief sets an emitting Diffuse color for the Light 86 \param r red 87 \param g green 88 \param b blue 89 */ 90 void Light::setDiffuseColor(GLfloat r, GLfloat g, GLfloat b) 91 { 92 this->diffuseColor[0] = r; 93 this->diffuseColor[1] = g; 94 this->diffuseColor[2] = b; 95 this->diffuseColor[3] = 1.0; 96 97 glLightfv (GL_LIGHT0, GL_DIFFUSE, diffuseColor); 98 } 41 99 42 100 43 101 /** 44 \brief nonsense - delete this method 45 \param realy nothing to give 46 \returns true or false - probably nothing? 102 \brief sets an emitting Ambient color for the Light 103 \param r red 104 \param g green 105 \param b blue 106 */ 107 void Light::setSpecularColor(GLfloat r, GLfloat g, GLfloat b) 108 { 109 this->specularColor[0] = r; 110 this->specularColor[1] = g; 111 this->specularColor[2] = b; 112 this->specularColor[3] = 1.0; 47 113 48 this is just to show the doxygen abilities (this for example is an extension for a long comment) 114 glLightfv (GL_LIGHT0, GL_SPECULAR, specularColor); 115 } 116 117 // get Attributes 118 119 /** 120 \returns the Position of the Light 49 121 */ 50 bool ProtoClass::doNonSense (int nothing) {} 122 Vector Light::getPosition(void) 123 { 124 Vector tmpPosition(lightPosition[0], lightPosition[1], lightPosition[2]); 125 return tmpPosition; 126 } -
orxonox/trunk/src/light.h
r3435 r3436 1 1 /*! 2 \file proto_class.h 3 \brief Definition of the proto class template, used quickly start work 4 \todo Example: this shows how to use simply add a Marker that here has to be done something. 2 \file light.h 3 \brief Handles Lights. 5 4 6 The Protoclass exists, to help you quikly getting the run for how to develop in orxonox. 7 It is an example for the CODING-CONVENTION, and a starting-point for every class. 5 A Light is one of the more important things in a 3D-environment, 6 without it one sees nothing :) 7 It is here for diffuse-, specular- and Bump-Mappings. 8 8 */ 9 9 10 #ifndef _ PROTO_CLASS_H11 #define _ PROTO_CLASS_H10 #ifndef _LIGHT_H 11 #define _LIGHT_H 12 12 13 #include "stdincl.h" 13 #include "world_entity.h" 14 #include "glincl.h" 14 15 15 /*class Test;*/ /* forward definition of class Test (without including it here!)*/ 16 // FORWARD DEFINITIONS // 17 class Vector; 16 18 17 //! A default class that aids you to start creating a new class19 //! A class that handles Lights 18 20 /** 19 here can be some longer description of this class21 A Light is a source that emits light rays (photons) 20 22 */ 21 class ProtoClass : public BaseObject { 23 class Light : public WorldEntity 24 { 25 22 26 23 27 public: 24 ProtoClass (); 25 ~ProtoClass (); 28 Light(void); 29 Light(Vector position); 30 ~Light(void); 26 31 27 bool doNonSense (int nothing); 32 // set Attributes 33 void setPosition(Vector position); 34 void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b); 35 void setSpecularColor(GLfloat r, GLfloat g, GLfloat b); 36 37 // get Attributes 38 Vector getPosition(void); 39 private: 40 GLfloat lightPosition[4]; //!< The Position of this Light 41 GLfloat lmodelAmbient[4]; //!< The general Ambient Color 42 GLfloat diffuseColor[4]; //!< The Diffuse Color this Light emmits 43 GLfloat specularColor[4]; //!< The specular Color of this Light 28 44 29 private: 30 int nonSense; //!< doxygen tag here like this for all the variables - delete this variable if you use this 31 45 void init(); 32 46 }; 33 47 34 #endif /* _ PROTO_CLASS_H */48 #endif /* _LIGHT_H */ -
orxonox/trunk/src/orxonox.cc
r3398 r3436 173 173 glClearColor (0.0, 0.0, 0.0, 0.0); 174 174 glEnable (GL_DEPTH_TEST); 175 176 // LIGHTING177 GLfloat lmodelAmbient[] = {.1, .1, .1, 1.0};178 GLfloat whiteLight[] = {1.0, 1.0, 1.0,1.0};179 GLfloat lightPosition[] = {10.0, 10, 19.0, 0.0};180 181 glLightfv (GL_LIGHT0, GL_DIFFUSE, whiteLight);182 glLightfv (GL_LIGHT0, GL_SPECULAR, whiteLight);183 glEnable (GL_LIGHTING);184 glEnable (GL_LIGHT0);185 glEnable (GL_DEPTH_TEST);186 glLightfv (GL_LIGHT0, GL_POSITION, lightPosition);187 glLightfv (GL_LIGHT0, GL_DIFFUSE, whiteLight);188 175 189 //glEnable (GL_TEXTURE_2D);190 // glEnable(GL_COLOR);191 // glShadeModel(GL_SMOOTH);192 193 // create camera194 //localcamera = new Camera(world); /* \todo camera/input node not used anymore*/195 196 176 return 0; 197 177 } -
orxonox/trunk/src/world.cc
r3433 r3436 28 28 #include "glmenu_imagescreen.h" 29 29 #include "skysphere.h" 30 #include "light.h" 30 31 31 32 using namespace std; … … 171 172 void World::load() 172 173 { 174 light0 = new Light(Vector(10.0, 10.0, 19.0)); 175 173 176 // BezierCurve* tmpCurve = new BezierCurve(); 174 177 if(this->debugWorldNr != -1) -
orxonox/trunk/src/world.h
r3433 r3436 17 17 class GLMenuImageScreen; 18 18 class Skysphere; 19 class Light; 19 20 20 21 //! The game environment … … 76 77 SDL_Surface *loadImage; 77 78 Skysphere* skySphere; 79 Light* light0; 78 80 79 81 WorldEntity* localPlayer;
Note: See TracChangeset
for help on using the changeset viewer.