| 246 | } |
| 247 | |
| 248 | void ProcessedFFMaterial::_setPrimaryLightInfo(const MatrixF &_objTrans, LightInfo* light, U32 pass) |
| 249 | { |
| 250 | // Just in case |
| 251 | GFX->setGlobalAmbientColor(ColorF(0.0f, 0.0f, 0.0f, 1.0f)); |
| 252 | if ( light->getType() == LightInfo::Ambient ) |
| 253 | { |
| 254 | // Ambient light |
| 255 | GFX->setGlobalAmbientColor( light->getAmbient() ); |
| 256 | return; |
| 257 | } |
| 258 | |
| 259 | GFX->setLight(0, NULL); |
| 260 | GFX->setLight(1, NULL); |
| 261 | // This is a quick hack that lets us use FF lights |
| 262 | GFXLightMaterial lightMat; |
| 263 | lightMat.ambient = ColorF(1.0f, 1.0f, 1.0f, 1.0f); |
| 264 | lightMat.diffuse = ColorF(1.0f, 1.0f, 1.0f, 1.0f); |
| 265 | lightMat.emissive = ColorF(0.0f, 0.0f, 0.0f, 0.0f); |
| 266 | lightMat.specular = ColorF(0.0f, 0.0f, 0.0f, 0.0f); |
| 267 | lightMat.shininess = 128.0f; |
| 268 | GFX->setLightMaterial(lightMat); |
| 269 | |
| 270 | // set object transform |
| 271 | MatrixF objTrans = _objTrans; |
| 272 | objTrans.inverse(); |
| 273 | |
| 274 | // fill in primary light |
| 275 | //------------------------- |
| 276 | GFXLightInfo xlatedLight; |
| 277 | light->setGFXLight(&xlatedLight); |
| 278 | Point3F lightPos = light->getPosition(); |
| 279 | Point3F lightDir = light->getDirection(); |
| 280 | objTrans.mulP(lightPos); |
| 281 | objTrans.mulV(lightDir); |
| 282 | |
| 283 | xlatedLight.mPos = lightPos; |
| 284 | xlatedLight.mDirection = lightDir; |
| 285 | |
| 286 | GFX->setLight(0, &xlatedLight); |
| 287 | } |
| 288 | |
| 289 | void ProcessedFFMaterial::_setSecondaryLightInfo(const MatrixF &_objTrans, LightInfo* light) |
| 290 | { |
nothing calls this directly
no test coverage detected