- Timestamp:
- Mar 1, 2005, 8:24:04 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/light.cc
r3437 r3438 38 38 for (int i = 0; i < NUMBEROFLIGHTS; i++) 39 39 lights[i] = NULL; 40 this->currentLight = new LightValue;40 this->currentLight = NULL; 41 41 } 42 42 … … 56 56 } 57 57 58 /** 59 \brief singleton-Reference to the Light-class 60 */ 58 61 Light* Light::singletonRef = NULL; 59 62 … … 125 128 void Light::editLightNumber(int lightNumber) 126 129 { 130 if (!this->currentLight) 131 { 132 PRINTF(1)("no Light defined yet\n"); 133 return; 134 } 135 127 136 this->currentLight = lights[lightNumber]; 128 137 } … … 133 142 void Light::deleteLight(void) 134 143 { 144 if (!this->currentLight) 145 { 146 PRINTF(1)("no Light defined yet\n"); 147 return; 148 } 149 135 150 this->deleteLight(this->currentLight->lightNumber); 136 151 } … … 151 166 } 152 167 153 154 155 168 // set Attributes 156 169 /** … … 161 174 void Light::setPosition(Vector position) 162 175 { 176 if (!this->currentLight) 177 { 178 PRINTF(1)("no Light defined yet\n"); 179 return; 180 } 163 181 this->currentLight->lightPosition[0] = position.x; 164 182 this->currentLight->lightPosition[1] = position.y; … … 171 189 void Light::setPosition(GLfloat x, GLfloat y, GLfloat z) 172 190 { 191 if (!this->currentLight) 192 { 193 PRINTF(1)("no Light defined yet\n"); 194 return; 195 } 196 173 197 this->currentLight->lightPosition[0] = x; 174 198 this->currentLight->lightPosition[1] = y; … … 187 211 void Light::setDiffuseColor(GLfloat r, GLfloat g, GLfloat b) 188 212 { 213 if (!this->currentLight) 214 { 215 PRINTF(1)("no Light defined yet\n"); 216 return; 217 } 218 189 219 this->currentLight->diffuseColor[0] = r; 190 220 this->currentLight->diffuseColor[1] = g; … … 204 234 void Light::setSpecularColor(GLfloat r, GLfloat g, GLfloat b) 205 235 { 236 if (!this->currentLight) 237 { 238 PRINTF(1)("no Light defined yet\n"); 239 return; 240 } 241 206 242 this->currentLight->specularColor[0] = r; 207 243 this->currentLight->specularColor[1] = g; … … 219 255 Vector Light::getPosition(void) 220 256 { 221 Vector tmpPosition(this->currentLight->lightPosition[0], this->currentLight->lightPosition[1], this->currentLight->lightPosition[2]); 222 return tmpPosition; 223 } 257 if (!this->currentLight) 258 { 259 PRINTF(1)("no Light defined yet\n"); 260 return Vector(.0, .0, .0); 261 } 262 else 263 return Vector(this->currentLight->lightPosition[0], this->currentLight->lightPosition[1], this->currentLight->lightPosition[2]); 264 } -
orxonox/trunk/src/world.cc
r3437 r3438 173 173 { 174 174 light = Light::getInstance(); 175 light->addLight( 1);175 light->addLight(0); 176 176 light->setPosition(10.0, 10.0, 19.0); 177 177
Note: See TracChangeset
for help on using the changeset viewer.