| 245 | //----------------------------------------------------------------------------- |
| 246 | |
| 247 | F32 SpriteBatchQuery::RayCastCallback( const b2RayCastInput& input, S32 proxyId ) |
| 248 | { |
| 249 | // Debug Profiling. |
| 250 | PROFILE_SCOPE(SpriteBatchQuery_RayCastCallback); |
| 251 | |
| 252 | // Fetch sprite batch item. |
| 253 | SpriteBatchItem* pSpriteBatchItem = static_cast<SpriteBatchItem*>(GetUserData( proxyId )); |
| 254 | |
| 255 | // Ignore if already tagged with the sprite batch query key. |
| 256 | if ( pSpriteBatchItem->getSpriteBatchQueryKey() == mMasterQueryKey ) |
| 257 | return 1.0f; |
| 258 | |
| 259 | // Check OOBB. |
| 260 | if ( mCheckOOBB ) |
| 261 | { |
| 262 | // Fetch the shapes render OOBB. |
| 263 | b2PolygonShape oobb; |
| 264 | oobb.Set( pSpriteBatchItem->getLocalOOBB(), 4); |
| 265 | b2RayCastOutput rayOutput; |
| 266 | if ( !oobb.RayCast( &rayOutput, mCompareRay, mCompareTransform, 0 ) ) |
| 267 | return true; |
| 268 | } |
| 269 | |
| 270 | // Tag with world query key. |
| 271 | pSpriteBatchItem->setSpriteBatchQueryKey( mMasterQueryKey ); |
| 272 | |
| 273 | SpriteBatchQueryResult queryResult( pSpriteBatchItem ); |
| 274 | mQueryResults.push_back( queryResult ); |
| 275 | |
| 276 | return 1.0f; |
| 277 | } |
| 278 | |
| 279 | //----------------------------------------------------------------------------- |
| 280 |
nothing calls this directly
no test coverage detected