MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _getFogColor

Method _getFogColor

Engine/source/environment/scatterSky.cpp:1333–1378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1331}
1332
1333void ScatterSky::_getFogColor( LinearColorF *outColor )
1334{
1335 PROFILE_SCOPE( ScatterSky_GetFogColor );
1336
1337 VectorF scatterPos( 0, 0, 0 );
1338
1339 F32 sunBrightness = mSkyBrightness;
1340 mSkyBrightness *= 0.25f;
1341
1342 F32 yaw = 0, pitch = 0, originalYaw = 0;
1343 VectorF fwd( 0, 1.0f, 0 );
1344 MathUtils::getAnglesFromVector( fwd, yaw, pitch );
1345 originalYaw = yaw;
1346 pitch = mDegToRad( 10.0f );
1347
1348 LinearColorF tmpColor( 0, 0, 0 );
1349
1350 U32 i = 0;
1351 for ( i = 0; i < 10; i++ )
1352 {
1353 MathUtils::getVectorFromAngles( scatterPos, yaw, pitch );
1354
1355 scatterPos.x *= smEarthRadius + smAtmosphereRadius;
1356 scatterPos.y *= smEarthRadius + smAtmosphereRadius;
1357 scatterPos.z *= smEarthRadius + smAtmosphereRadius;
1358 scatterPos.y -= smEarthRadius;
1359
1360 _getColor( scatterPos, &tmpColor );
1361 (*outColor) += tmpColor;
1362
1363 if ( i <= 5 )
1364 yaw += mDegToRad( 5.0f );
1365 else
1366 {
1367 originalYaw += mDegToRad( -5.0f );
1368 yaw = originalYaw;
1369 }
1370
1371 yaw = mFmod( yaw, M_2PI_F );
1372 }
1373
1374 if ( i > 0 )
1375 (*outColor) /= i;
1376
1377 mSkyBrightness = sunBrightness;
1378}
1379
1380F32 ScatterSky::_vernierScale( F32 fCos )
1381{

Callers

nothing calls this directly

Calls 4

getAnglesFromVectorFunction · 0.85
mDegToRadFunction · 0.85
getVectorFromAnglesFunction · 0.85
mFmodFunction · 0.85

Tested by

no test coverage detected