| 277 | } |
| 278 | |
| 279 | void SceneController::scrollIslands( float deltaTime ) |
| 280 | { |
| 281 | float pointsPerSecond = mParams.mDecentSpeed; |
| 282 | mCurrentDecent -= pointsPerSecond * deltaTime; |
| 283 | |
| 284 | float deltaDecentMeters = pointsToMeters( pointsPerSecond ) * deltaTime; |
| 285 | float islandHeightMeters = pointsToMeters( FUNNEL_MAX_HEIGHT ); |
| 286 | |
| 287 | for( auto &islandGroup : mIslands ) { |
| 288 | bool needsReConfig = false; |
| 289 | |
| 290 | for( auto &island : islandGroup ) { |
| 291 | b2Vec2 pos = island->mBody->GetPosition(); |
| 292 | pos.y -= deltaDecentMeters; |
| 293 | |
| 294 | if( pos.y < - islandHeightMeters ) { |
| 295 | needsReConfig = true; |
| 296 | break; |
| 297 | } |
| 298 | |
| 299 | island->mBody->SetTransform( pos, 0 ); |
| 300 | } |
| 301 | |
| 302 | if( needsReConfig ) |
| 303 | reConfigIslandGroup( islandGroup, 0 ); |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | void SceneController::reConfigIslandGroup( IslandContainerT &islandGroup, float yOffset ) |
| 308 | { |
nothing calls this directly
no test coverage detected