void Box2DTestApp::update() { if (mousePressed) particleController.addParticle(mousePos); particleController.update(); // step physics world float32 timeStep = 1.0f / 60.0f; int32 velocityIterations = 6; int32 positionIterations = 2; world.Step(timeStep, velocityIterations, positionIterations); }
void VideoPanApp::update() { if( mMovie.checkNewFrame() ) { mMovieFrame = gl::Texture(mMovie.getTexture()); if( particleCount < maxParticles ) { mParticleController.addParticle( gl::Texture(mMovie.getTexture()) ); particleCount++; mMovie.stepForward(); } } else { mParticleController.setWidth(mParticleWidth); mParticleController.setPixelOffset(mPixelOffset); mParticleController.update(); } }
void RoboticaProjectApp::update() { //get the latest pcm buffer from the track mPcmBuffer = mTrack->getPcmBuffer(); if( mPcmBuffer ){ // mPcmBuffer->getChannelData( audio::CHANNEL_FRONT_LEFT ) fftRef = audio::calculateFft( mPcmBuffer->getChannelData( audio::CHANNEL_FRONT_LEFT ), bandCount ); if(mAddParticle){ particleC->addParticle(mAddPos); mAddParticle = false; } particleC->update(fftRef, bandCount, getElapsedSeconds()); } }
//------------------------------------------------------------ //-- //------------------------------------------------------------ void cdr_Snow::mouseMove( MouseEvent event ) { cinder::Vec2i pos = event.getPos(); myParticles.addParticle( pos.x, pos.y, 10 ); }