MCPcopy Create free account
hub / github.com/cinder/Cinder / scrollIslands

Method scrollIslands

samples/FallingGears/src/SceneController.cpp:279–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279void 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
307void SceneController::reConfigIslandGroup( IslandContainerT &islandGroup, float yOffset )
308{

Callers

nothing calls this directly

Calls 2

pointsToMetersFunction · 0.85
SetTransformMethod · 0.80

Tested by

no test coverage detected