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

Method removeOffscreenGears

samples/FallingGears/src/SceneController.cpp:265–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265void SceneController::removeOffscreenGears()
266{
267 float windowHeightMeters = pointsToMeters( app::getWindowHeight() );
268
269 for( auto &gear : mGears ) {
270 if( gear->mBody->GetPosition().y > windowHeightMeters )
271 gear->mBody.reset();
272 }
273
274 mGears.erase( remove_if( mGears.begin(), mGears.end(),
275 []( const shared_ptr<Gear> &gear ) { return ! gear->mBody; } ),
276 mGears.end() );
277}
278
279void SceneController::scrollIslands( float deltaTime )
280{

Callers

nothing calls this directly

Calls 6

pointsToMetersFunction · 0.85
getWindowHeightFunction · 0.85
resetMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected