| 376 | } |
| 377 | |
| 378 | void ProjectedShadow::_calcScore( const SceneRenderState *state ) |
| 379 | { |
| 380 | if ( !mDecalInstance ) |
| 381 | return; |
| 382 | |
| 383 | F32 pixRadius = mDecalInstance->calcPixelSize( state->getViewport().extent.y, state->getCameraPosition(), state->getWorldToScreenScale().y ); |
| 384 | |
| 385 | F32 pct = pixRadius / mDecalInstance->mDataBlock->fadeStartPixelSize; |
| 386 | |
| 387 | U32 msSinceLastRender = Platform::getVirtualMilliseconds() - getLastRenderTime(); |
| 388 | |
| 389 | ShapeBaseData *data = NULL; |
| 390 | if ( mShapeBase ) |
| 391 | data = static_cast<ShapeBaseData*>( mShapeBase->getDataBlock() ); |
| 392 | |
| 393 | // For every 1s this shadow hasn't been |
| 394 | // updated we'll add 10 to the score. |
| 395 | F32 secs = mFloor( (F32)msSinceLastRender / 1000.0f ); |
| 396 | |
| 397 | mScore = pct + secs; |
| 398 | mClampF( mScore, 0.0f, 2000.0f ); |
| 399 | } |
| 400 | |
| 401 | void ProjectedShadow::update( const SceneRenderState *state ) |
| 402 | { |
nothing calls this directly
no test coverage detected