| 59 | } |
| 60 | |
| 61 | void LightQuery::getLights( LightInfo** outLights, U32 maxLights ) |
| 62 | { |
| 63 | PROFILE_SCOPE( LightQuery_getLights ); |
| 64 | |
| 65 | // Gather lights if we haven't already. |
| 66 | if ( mLights.empty() ) |
| 67 | _scoreLights(); |
| 68 | |
| 69 | U32 lightCount = getMin( (U32)mLights.size(), getMin( mMaxLights, maxLights ) ); |
| 70 | |
| 71 | // Copy them over. |
| 72 | for ( U32 i = 0; i < lightCount; i++ ) |
| 73 | { |
| 74 | LightInfo *light = mLights[i]; |
| 75 | |
| 76 | // If the score reaches zero then we got to |
| 77 | // the end of the valid lights for this object. |
| 78 | if ( light->getScore() <= 0.0f ) |
| 79 | break; |
| 80 | |
| 81 | outLights[i] = light; |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | void LightQuery::_scoreLights() |
| 86 | { |
no test coverage detected