Changeset 3597 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Mar 17, 2005, 11:04:59 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/defs/debug.h
r3596 r3597 47 47 #define DEBUG_MODULE_ORXONOX 0 48 48 #define DEBUG_MODULE_WORLD 0 49 #define DEBUG_MODULE_PNODE 349 #define DEBUG_MODULE_PNODE 0 50 50 #define DEBUG_MODULE_WORLD_ENTITY 0 51 51 #define DEBUG_MODULE_COMMAND_NODE 0 -
orxonox/trunk/src/light.cc
r3590 r3597 27 27 int lightsV[] = {GL_LIGHT0, GL_LIGHT1, GL_LIGHT2, GL_LIGHT3, GL_LIGHT4, GL_LIGHT5, GL_LIGHT6, GL_LIGHT7}; 28 28 29 29 Light::Light(int lightNumber) 30 { 31 PRINTF(4)("initializing Light number %d.\n", lightNumber); 32 // enable The light 33 glEnable(lightsV[lightNumber]); // postSpawn 34 35 // set values (defaults) 36 this->lightNumber = lightNumber; 37 this->setPosition(0.0, 0.0, 0.0); 38 this->setDiffuseColor(1.0, 1.0, 1.0); 39 this->setSpecularColor(1.0, 1.0, 1.0); 40 } 41 42 Light::~Light(void) 43 { 44 glDisable(lightsV[this->lightNumber]); 45 } 46 47 /** 48 \brief Sets a Position for the Light. 49 \param position The new position of the Light. 50 \todo patrick: is it ok to set a Light Position even if it is derived from p_node?? 51 */ 52 void Light::setPosition(Vector position) 53 { 54 this->lightPosition[0] = position.x; 55 this->lightPosition[1] = position.y; 56 this->lightPosition[2] = position.z; 57 this->lightPosition[3] = 0.0; 58 59 glLightfv (GL_LIGHT0, GL_POSITION, this->lightPosition); 60 } 61 62 /** 63 \brief Sets a Position for the Light. 64 \param x the x-coordinate 65 \param y the y-coordinate 66 \param z the z-coordinate 67 */ 68 void Light::setPosition(GLfloat x, GLfloat y, GLfloat z) 69 { 70 this->lightPosition[0] = x; 71 this->lightPosition[1] = y; 72 this->lightPosition[2] = z; 73 this->lightPosition[3] = 0.0; 74 75 glLightfv (GL_LIGHT0, GL_POSITION, this->lightPosition); 76 } 77 78 /** 79 \brief sets an emitting Diffuse color for the Light 80 \param r red 81 \param g green 82 \param b blue 83 */ 84 void Light::setDiffuseColor(GLfloat r, GLfloat g, GLfloat b) 85 { 86 this->diffuseColor[0] = r; 87 this->diffuseColor[1] = g; 88 this->diffuseColor[2] = b; 89 this->diffuseColor[3] = 1.0; 90 91 glLightfv (GL_LIGHT0, GL_DIFFUSE, this->diffuseColor); 92 } 93 94 /** 95 \brief sets an emitting Ambient color for the Light 96 \param r red 97 \param g green 98 \param b blue 99 */ 100 void Light::setSpecularColor(GLfloat r, GLfloat g, GLfloat b) 101 { 102 this->specularColor[0] = r; 103 this->specularColor[1] = g; 104 this->specularColor[2] = b; 105 this->specularColor[3] = 1.0; 106 107 glLightfv (GL_LIGHT0, GL_SPECULAR, this->specularColor); 108 } 109 110 /** 111 \brief Sets the AttenuationType of this Light Source 112 \param type the AttenuationType to set 113 \param factor the Factor to multipy the attenuation with 114 115 this actually just sets the following: glLightf(currentLight, type, factor) 116 */ 117 void Light::setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation) 118 { 119 this->constantAttenuation = constantAttenuation; 120 this->linearAttenuation = linearAttenuation; 121 this->quadraticAttenuation = quadraticAttenuation; 122 123 glLightf(lightsV[this->lightNumber], GL_CONSTANT_ATTENUATION, constantAttenuation); 124 glLightf(lightsV[this->lightNumber], GL_LINEAR_ATTENUATION, linearAttenuation); 125 glLightf(lightsV[this->lightNumber], GL_QUADRATIC_ATTENUATION, quadraticAttenuation); 126 } 127 128 /** 129 \brief stets the direction of the Spot Light. 130 \param direction The direction of the Spot Light. 131 */ 132 void Light::setSpotDirection(Vector direction) 133 { 134 this->spotDirection[0] = direction.x; 135 this->spotDirection[1] = direction.y; 136 this->spotDirection[2] = direction.z; 137 138 glLightfv(lightsV[this->lightNumber], GL_SPOT_DIRECTION, this->spotDirection); 139 } 140 141 142 /** 143 \brief sets the cutoff angle of the Light. 144 \param cutoff The cutoff angle. 145 */ 146 void Light::setSpotCutoff(GLfloat cutoff) 147 { 148 this->spotCutoff = cutoff; 149 glLightf(lightsV[this->lightNumber], GL_SPOT_CUTOFF, cutoff); 150 } 151 152 void Light::draw() 153 { 154 float pos[3] = {this->getAbsCoor ().x, this->getAbsCoor().y, this->getAbsCoor().z}; 155 glLightfv(lightsV[this->lightNumber], GL_POSITION, pos); 156 } 157 158 void Light::debug(void) 159 { 160 PRINT(0)(":: %d :: -- reference %p\n", this->lightNumber, this); 161 PRINT(0)(" GL-state: "); 162 GLboolean param; 163 glGetBooleanv(lightsV[this->lightNumber], ¶m); 164 if (param) 165 PRINT(0)("ON\n"); 166 else 167 PRINT(0)("OFF\n"); 168 169 PRINT(0)(" Position: %f/%f/%f\n", this->lightPosition[0], this->lightPosition[1], this->lightPosition[2]); 170 PRINT(0)(" DiffuseColor: %f/%f/%f\n", this->diffuseColor[0], this->diffuseColor[1], this->diffuseColor[2]); 171 PRINT(0)(" SpecularColor: %f/%f/%f\n", this->specularColor[0], this->specularColor[1], this->specularColor[2]); 172 PRINT(0)(" Attenuation: constant=%f linear=%f quadratic=%f\n", this->constantAttenuation, this->linearAttenuation, this->quadraticAttenuation); 173 } 174 175 176 /****************** 177 ** LIGHT-MANAGER ** 178 ******************/ 30 179 /** 31 180 \brief standard constructor for a Light 32 181 */ 33 Light ::Light()34 { 35 this->setClassName ("Light ");182 LightManager::LightManager () 183 { 184 this->setClassName ("LightManager"); 36 185 37 186 glEnable (GL_LIGHTING); 38 187 this->setAmbientColor(.3, .3, .3); 39 this->lights = new Light Value*[NUMBEROFLIGHTS];188 this->lights = new Light*[NUMBEROFLIGHTS]; 40 189 for (int i = 0; i < NUMBEROFLIGHTS; i++) 41 190 lights[i] = NULL; … … 51 200 and in the end sets the singleton Reference to zero. 52 201 */ 53 Light ::~Light()202 LightManager::~LightManager () 54 203 { 55 204 glDisable(GL_LIGHTING); 56 205 57 for (int i = 0; i < NUMBEROFLIGHTS; i++) 58 this->deleteLight(i); 206 // this will be done either by worldEntity, or by pNode as each light is one of them 207 // for (int i = 0; i < NUMBEROFLIGHTS; i++) 208 // this->deleteLight(i); 59 209 delete lights; 60 Light ::singletonRef = NULL;210 LightManager::singletonRef = NULL; 61 211 } 62 212 … … 64 214 \brief singleton-Reference to the Light-class 65 215 */ 66 Light * Light::singletonRef = NULL;216 LightManager* LightManager::singletonRef = NULL; 67 217 68 218 /** 69 219 \returns The Instance of the Lights 70 220 */ 71 Light* Light::getInstance(void) 72 { 73 if (singletonRef) 74 return singletonRef; 75 else 76 return Light::singletonRef = new Light(); 221 LightManager* LightManager::getInstance(void) 222 { 223 if (!singletonRef) 224 LightManager::singletonRef = new LightManager(); 225 return singletonRef; 77 226 } 78 227 … … 80 229 \brief initializes a new Light with default values, and enables GL_LIGHTING 81 230 */ 82 void Light::init(int lightNumber) 83 { 84 PRINTF(3)("initializing Light number %d.\n", lightNumber); 85 // enable The light 86 glEnable(lightsV[lightNumber]); 87 this->currentLight = lights[lightNumber] = new LightValue; 88 89 // set default values 90 this->currentLight->lightNumber = lightNumber; 91 this->setPosition(0.0, 0.0, 0.0); 92 this->setDiffuseColor(1.0, 1.0, 1.0); 93 this->setSpecularColor(1.0, 1.0, 1.0); 231 void LightManager::initLight(int lightNumber) 232 { 233 lights[lightNumber] = new Light(lightNumber); 94 234 } 95 235 … … 99 239 if no slot is free error 100 240 */ 101 int Light ::addLight(void)241 int LightManager::addLight(void) 102 242 { 103 243 for (int i = 0; i < NUMBEROFLIGHTS; i++) … … 114 254 if the Number is not free: warn, automatically choose another slot. 115 255 */ 116 int Light ::addLight(int lightNumber)256 int LightManager::addLight(int lightNumber) 117 257 { 118 258 if (this->lights[lightNumber]) … … 121 261 return this->addLight(); 122 262 } 123 this->init (lightNumber);263 this->initLight(lightNumber); 124 264 this->currentLight = this->lights[lightNumber]; 125 265 return lightNumber; … … 130 270 \param lightNumber the light to work with 131 271 */ 132 void Light ::editLightNumber(int lightNumber)272 void LightManager::editLightNumber(int lightNumber) 133 273 { 134 274 if (!this->currentLight) 135 275 { 136 PRINTF( 1)("no Light defined yet\n");276 PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n"); 137 277 return; 138 278 } 139 140 279 this->currentLight = lights[lightNumber]; 141 280 } … … 144 283 \brief Delete the current Light 145 284 */ 146 void Light ::deleteLight(void)285 void LightManager::deleteLight(void) 147 286 { 148 287 if (!this->currentLight) 149 288 { 150 PRINTF(1)("no Light defined yet \n");289 PRINTF(1)("no Light defined yet. So you cannot delete any Light right now.\n"); 151 290 return; 152 291 } … … 159 298 \param lightNumber the number of the light to delete 160 299 */ 161 void Light ::deleteLight(int lightNumber)300 void LightManager::deleteLight(int lightNumber) 162 301 { 163 302 if (this->lights[lightNumber]) 164 303 { 165 PRINTF( 3)("deleting Light number %d\n", lightNumber);304 PRINTF(4)("deleting Light number %d\n", lightNumber); 166 305 delete this->lights[lightNumber]; 167 glDisable(lightsV[lightNumber]);168 306 this->lights[lightNumber] = NULL; 169 307 } … … 171 309 172 310 // set Attributes 173 /**174 \brief Sets a Position for the Light.175 \param position The new position of the Light.176 \todo patrick: is it ok to set a Light Position even if it is derived from p_node??177 */178 void Light::setPosition(Vector position)179 {180 if (!this->currentLight)181 {182 PRINTF(1)("no Light defined yet\n");183 return;184 }185 this->currentLight->lightPosition[0] = position.x;186 this->currentLight->lightPosition[1] = position.y;187 this->currentLight->lightPosition[2] = position.z;188 this->currentLight->lightPosition[3] = 0.0;189 190 glLightfv (GL_LIGHT0, GL_POSITION, this->currentLight->lightPosition);191 }192 193 /**194 \brief Sets a Position for the Light.195 \param x the x-coordinate196 \param y the y-coordinate197 \param z the z-coordinate198 */199 void Light::setPosition(GLfloat x, GLfloat y, GLfloat z)200 {201 if (!this->currentLight)202 {203 PRINTF(1)("no Light defined yet\n");204 return;205 }206 207 this->currentLight->lightPosition[0] = x;208 this->currentLight->lightPosition[1] = y;209 this->currentLight->lightPosition[2] = z;210 this->currentLight->lightPosition[3] = 0.0;211 212 glLightfv (GL_LIGHT0, GL_POSITION, this->currentLight->lightPosition);213 }214 215 /**216 \brief sets an emitting Diffuse color for the Light217 \param r red218 \param g green219 \param b blue220 */221 void Light::setDiffuseColor(GLfloat r, GLfloat g, GLfloat b)222 {223 if (!this->currentLight)224 {225 PRINTF(1)("no Light defined yet\n");226 return;227 }228 229 this->currentLight->diffuseColor[0] = r;230 this->currentLight->diffuseColor[1] = g;231 this->currentLight->diffuseColor[2] = b;232 this->currentLight->diffuseColor[3] = 1.0;233 234 glLightfv (GL_LIGHT0, GL_DIFFUSE, this->currentLight->diffuseColor);235 }236 237 238 /**239 \brief sets an emitting Ambient color for the Light240 \param r red241 \param g green242 \param b blue243 */244 void Light::setSpecularColor(GLfloat r, GLfloat g, GLfloat b)245 {246 if (!this->currentLight)247 {248 PRINTF(1)("no Light defined yet\n");249 return;250 }251 252 this->currentLight->specularColor[0] = r;253 this->currentLight->specularColor[1] = g;254 this->currentLight->specularColor[2] = b;255 this->currentLight->specularColor[3] = 1.0;256 257 glLightfv (GL_LIGHT0, GL_SPECULAR, this->currentLight->specularColor);258 }259 260 /**261 \brief Sets the AttenuationType of this Light Source262 \param type the AttenuationType to set263 \param factor the Factor to multipy the attenuation with264 265 this actually just sets the following: glLightf(currentLight, type, factor)266 */267 void Light::setAttenuation(AttenuationType type, float factor)268 {269 if (!this->currentLight)270 {271 PRINTF(1)("no Light defined yet\n");272 return;273 }274 this->currentLight->attenuationFactor = factor;275 this->currentLight->attenuationType = type;276 switch (type)277 {278 case CONSTANT:279 glLightf(lightsV[this->currentLight->lightNumber], GL_CONSTANT_ATTENUATION, factor);280 break;281 case LINEAR:282 glLightf(lightsV[this->currentLight->lightNumber], GL_LINEAR_ATTENUATION, factor);283 break;284 case QUADRATIC:285 glLightf(lightsV[this->currentLight->lightNumber], GL_QUADRATIC_ATTENUATION, factor);286 break;287 }288 }289 290 291 311 /** 292 312 \brief sets the ambient Color of the Scene … … 295 315 \param b blue 296 316 */ 297 void Light ::setAmbientColor(GLfloat r, GLfloat g, GLfloat b)317 void LightManager::setAmbientColor(GLfloat r, GLfloat g, GLfloat b) 298 318 { 299 319 this->ambientColor[0] = r; … … 305 325 } 306 326 307 /** 308 \brief stets the direction of the Spot Light. 309 \param direction The direction of the Spot Light. 310 */ 311 void Light::setSpotDirection(Vector direction) 312 { 313 this->currentLight->spotDirection[0] = direction.x; 314 this->currentLight->spotDirection[1] = direction.y; 315 this->currentLight->spotDirection[2] = direction.z; 316 317 glLightfv(lightsV[this->currentLight->lightNumber], GL_SPOT_DIRECTION, this->currentLight->spotDirection); 318 } 319 320 321 /** 322 \brief sets the cutoff angle of the Light. 323 \param cutoff The cutoff angle. 324 */ 325 void Light::setSpotCutoff(GLfloat cutoff) 326 { 327 this->currentLight->spotCutoff = cutoff; 328 glLightf(lightsV[this->currentLight->lightNumber], GL_SPOT_CUTOFF, cutoff); 329 } 330 327 void LightManager::setPosition(Vector position) 328 { 329 this->currentLight->setPosition(position); 330 } 331 void LightManager::setPosition(GLfloat x, GLfloat y, GLfloat z) 332 { 333 this->currentLight->setPosition(x, y, z); 334 } 335 void LightManager::setDiffuseColor(GLfloat r, GLfloat g, GLfloat b) 336 { 337 this->currentLight->setDiffuseColor(r,g,b); 338 } 339 void LightManager::setSpecularColor(GLfloat r, GLfloat g, GLfloat b) 340 { 341 this->currentLight->setSpecularColor(r, g, b); 342 } 343 void LightManager::setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation) 344 { 345 this->currentLight->setAttenuation(constantAttenuation, linearAttenuation, quadraticAttenuation); 346 } 347 void LightManager::setSpotDirection(Vector direction) 348 { 349 this->currentLight->setSpotDirection(direction); 350 } 351 void LightManager::setSpotCutoff(GLfloat cutoff) 352 { 353 this->currentLight->setSpotCutoff(cutoff); 354 } 331 355 332 356 // get Attributes 333 334 357 /** 335 358 \returns the Position of the Light 336 359 */ 337 Vector Light ::getPosition(void)360 Vector LightManager::getPosition(void) 338 361 { 339 362 if (!this->currentLight) … … 346 369 } 347 370 348 349 350 351 371 /** 352 372 \brief outputs debug information about the Class and its lights 353 373 */ 354 void Light ::debug(void)374 void LightManager::debug(void) 355 375 { 356 376 PRINT(0)("=================================\n"); 357 377 PRINT(0)("= DEBUG INFORMATION CLASS LIGHT =\n"); 358 378 PRINT(0)("=================================\n"); 359 PRINT(0)("Reference: %p\n", Light ::singletonRef);379 PRINT(0)("Reference: %p\n", LightManager::singletonRef); 360 380 if (this->currentLight) 361 381 PRINT(0)("current Light Nr: %d\n", this->currentLight->lightNumber); … … 365 385 if (this->lights[i]) 366 386 { 367 PRINT(0)(":: %d :: -- reference %p\n", i, lights[i]); 368 PRINT(0)(" GL-state: "); 369 GLboolean param; 370 glGetBooleanv(lightsV[i], ¶m); 371 if (param) 372 PRINT(0)("ON\n"); 373 else 374 PRINT(0)("OFF\n"); 375 376 if (i != lights[i]->lightNumber) 377 PRINTF(1)(" Lights are out of sync, this really should not happen,\n %d % should be equal.\n", i, lights[i]->lightNumber); 378 PRINT(0)(" Position: %f/%f/%f\n", lights[i]->lightPosition[0], lights[i]->lightPosition[1], lights[i]->lightPosition[2]); 379 PRINT(0)(" DiffuseColor: %f/%f/%f\n", lights[i]->diffuseColor[0], lights[i]->diffuseColor[1], lights[i]->diffuseColor[2]); 380 PRINT(0)(" SpecularColor: %f/%f/%f\n", lights[i]->specularColor[0], lights[i]->specularColor[1], lights[i]->specularColor[2]); 381 PRINT(0)(" Attenuation: "); 382 switch (lights[i]->attenuationType) 383 { 384 case CONSTANT: 385 PRINT(0)("constant"); 386 case LINEAR: 387 PRINT(0)("linear"); 388 break; 389 case QUADRATIC: 390 PRINT(0)("quadratic"); 391 break; 392 } 393 PRINT(0)(" with Factor %f\n", lights[i]->attenuationFactor); 387 this->lights[i]->debug(); 394 388 } 395 389 PRINT(0)("--------------------------------\n"); -
orxonox/trunk/src/light.h
r3588 r3597 17 17 #define NUMBEROFLIGHTS GL_MAX_LIGHTS 18 18 19 //! Enumerator for the attenuation-Type.20 /**21 CONSTANT means GL_CONSTANT_ATTENUATION22 LINEAR means GL_LINEAR_ATTENUATION23 QUADRATIC means GL_QUADRATIC_ATTENUATION24 */25 enum AttenuationType {CONSTANT, LINEAR, QUADRATIC};26 27 19 // FORWARD DEFINITIONS // 28 20 class Vector; 21 22 //! A struct that holds information about a Light 23 class Light : public WorldEntity 24 { 25 public: 26 Light(int lightNumber); 27 ~Light(void); 28 29 void setPosition(Vector position); 30 void setPosition(GLfloat x, GLfloat y, GLfloat z); 31 void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b); 32 void setSpecularColor(GLfloat r, GLfloat g, GLfloat b); 33 void setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation); 34 void setSpotDirection(Vector direction); 35 void setSpotCutoff(GLfloat cutoff); 36 37 virtual void draw(); 38 39 // attributes 40 41 int lightNumber; //!< The number of this Light. 42 GLfloat lightPosition[4]; //!< The Position of this Light. 43 GLfloat diffuseColor[4]; //!< The Diffuse Color this Light emmits. 44 GLfloat specularColor[4]; //!< The specular Color of this Light. 45 float constantAttenuation; //!< The Factor of the the Constant Attenuation. 46 float linearAttenuation; //!< The Factor of the the Linear Attenuation. 47 float quadraticAttenuation; //!< The Factor of the the Quadratic Attenuation. 48 GLfloat spotDirection[4]; //!< The direction of the Spot Light. 49 GLfloat spotCutoff; //!< The cutoff Angle of the Light Source 50 51 void debug(void); 52 }; 29 53 30 54 //! A class that handles Lights … … 32 56 A Light is a source that emits light rays (photons) 33 57 */ 34 class Light : public BaseObject58 class LightManager : public BaseObject 35 59 { 36 60 private: 37 //! A struct that holds information about a Light 38 struct LightValue 39 { 40 int lightNumber; //!< The number of this Light. 41 GLfloat lightPosition[4]; //!< The Position of this Light. 42 GLfloat diffuseColor[4]; //!< The Diffuse Color this Light emmits. 43 GLfloat specularColor[4]; //!< The specular Color of this Light. 44 AttenuationType attenuationType;//!< The AttenuationType of this Light. 45 float attenuationFactor; //!< The Factor the attenuation should have. 46 GLfloat spotDirection[4]; //!< The direction of the Spot Light. 47 GLfloat spotCutoff; //!< The cutoff Angle of the Light Source 48 }; 49 50 static Light* singletonRef; //!< This is the LightHandlers Reference. 61 LightManager(void); 62 void initLight(int LightNumber); 63 64 static LightManager* singletonRef; //!< This is the LightHandlers Reference. 51 65 GLfloat ambientColor[4]; //!< The ambient Color of the scene. 52 66 53 54 Light(void); 55 56 void init(int LightNumber); 57 LightValue** lights; //!< An array of Lenght NUMBEROFLIGHTS, that holds pointers to all LightValues. 58 LightValue* currentLight; //!< The current Light, we are working with. 67 Light** lights; //!< An array of Lenght NUMBEROFLIGHTS, that holds pointers to all LightValues. 68 Light* currentLight; //!< The current Light, we are working with. 59 69 60 70 public: 61 static Light * getInstance();62 virtual ~Light (void);71 static LightManager* getInstance(); 72 virtual ~LightManager(void); 63 73 64 74 // set Attributes … … 69 79 void deleteLight(int lightNumber); 70 80 81 void setAmbientColor(GLfloat r, GLfloat g, GLfloat b); 82 83 //set Attributes 71 84 void setPosition(Vector position); 72 85 void setPosition(GLfloat x, GLfloat y, GLfloat z); 73 86 void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b); 74 87 void setSpecularColor(GLfloat r, GLfloat g, GLfloat b); 75 void setAttenuation(AttenuationType type, float factor); 76 void setAmbientColor(GLfloat r, GLfloat g, GLfloat b); 88 void setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation); 77 89 void setSpotDirection(Vector direction); 78 90 void setSpotCutoff(GLfloat cutoff); -
orxonox/trunk/src/story_entities/world.cc
r3596 r3597 73 73 delete this->nullParent; 74 74 delete this->entities; 75 delete this->light ;75 delete this->lightMan; 76 76 delete this->trackManager; 77 77 } … … 297 297 this->spawn(terrain); 298 298 // LIGHT initialisation 299 light = Light::getInstance(); 300 light->setAmbientColor(.1,.1,.1); 301 light->addLight(); 302 light->setAttenuation(QUADRATIC, 1.0); 303 light->setAttenuation(CONSTANT, 2.0); 304 light->setAttenuation(QUADRATIC, 1.0); 305 light->setPosition(10.0, 30.0, 10.0); 306 light->setDiffuseColor(1,1,1); 307 // light->addLight(1); 308 // light->setPosition(20, 10, -20); 309 // light->setDiffuseColor(0,0,0); 310 light->debug(); 299 lightMan = LightManager::getInstance(); 300 lightMan->setAmbientColor(.1,.1,.1); 301 lightMan->addLight(); 302 lightMan->setPosition(10.0, 30.0, 10.0); 303 lightMan->setAttenuation(1.0, 0, 0); 304 lightMan->setDiffuseColor(1,1,1); 305 // lightMan->addLight(1); 306 // lightMan->setPosition(20, 10, -20); 307 // lightMan->setDiffuseColor(0,0,0); 308 lightMan->debug(); 311 309 312 310 -
orxonox/trunk/src/story_entities/world.h
r3565 r3597 17 17 class GLMenuImageScreen; 18 18 class Skysphere; 19 class Light ;19 class LightManager; 20 20 class FontSet; 21 21 class Terrain; … … 72 72 73 73 PNode* nullParent; //!< The zero-point, that everything has as its parent. 74 TrackManager* trackManager; //!< The reference of the TrackManager that handles the course through the Level.75 Camera* localCamera; //!< The current Camera74 TrackManager* trackManager; //!< The reference of the TrackManager that handles the course through the Level. 75 Camera* localCamera; //!< The current Camera 76 76 Skysphere* skySphere; //!< The Environmental Heaven of orxonox \todo insert this to environment insted 77 Light * light;//!< The Lights of the Level77 LightManager* lightMan; //!< The Lights of the Level 78 78 Terrain* terrain; //!< The Terrain of the World. 79 79
Note: See TracChangeset
for help on using the changeset viewer.