本文整理汇总了C++中ParticleController::update方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleController::update方法的具体用法?C++ ParticleController::update怎么用?C++ ParticleController::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleController
的用法示例。
在下文中一共展示了ParticleController::update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void matrixP::update() {
if(mRenderAuto) {
framecounter++;
if(framecounter==CYCLELIMIT) {
typecounter++;
mGhostGoal.x = Rand::randFloat(0.0f, getWindowWidth() - 1.0f);
mGhostGoal.y = Rand::randFloat(0.0f, getWindowHeight() - 1.0f);
mStepX = (mGhostGoal.x - mGhostMouse.x)/CYCLELIMIT;
mStepY = (mGhostGoal.y - mGhostMouse.y)/CYCLELIMIT;
framecounter = 0;
}
if(typecounter==4) {
mRenderOrdered = !mRenderOrdered;
typecounter = 1;
}
mRenderColor = typecounter;
mGhostMouse.x += mStepX;
mGhostMouse.y += mStepY;
mParticleController.update(mRenderColor, mRenderOrdered, mGhostMouse);
}
else mParticleController.update(mRenderColor, mRenderOrdered, mMouseLoc);
printStats();
}
示例2:
void chapter3App::update()
{
if (! mChannel ) return;
if( mIsPressed )
mParticleController.addParticles( 5, mMouseLoc, mMouseVel );
mParticleController.update(perlin, mChannel, mMouseLoc );
}
示例3: update
void HellCinderApp::update()
{
if (particleCount < maxParticles) {
particleController.addParticles( particleIncrement );
particleCount += particleIncrement;
}
particleController.update(channel);
}
示例4: update
void TutorialApp::update()
{
if( ! mChannel ) return;
if( mIsPressed )
mParticleController.addParticles( NUM_PARTICLES_TO_SPAWN, mMouseLoc, mMouseVel );
mParticleController.update( mPerlin, mChannel, mMouseLoc );
}
示例5: update
void FlockingApp::update()
{
// UPDATE CAMERA
mEye = vec3( 0.0f, 0.0f, mCameraDistance );
mCam.lookAt( mEye, mCenter, mUp );
gl::setMatrices( mCam );
gl::rotate( mSceneRotation );
// UPDATE PARTICLE CONTROLLER
if( mCentralGravity ) mParticleController.pullToCenter( mCenter );
mParticleController.update();
}
示例6:
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);
}
示例7: update
void FlockingApp::update()
{
// UPDATE CAMERA
mEye = Vec3f( 0.0f, 0.0f, mCameraDistance );
mCam.lookAt( mEye, mCenter, mUp );
gl::setMatrices( mCam );
gl::rotate( mSceneRotation );
// UPDATE PARTICLE CONTROLLER AND PARTICLES
mParticleController.applyForceToParticles( mZoneRadius * mZoneRadius );
if( mCentralGravity ) mParticleController.pullToCenter( mCenter );
mParticleController.update( mFlatten );
}
示例8: update
void FlockingApp::update()
{
if( mLowerThresh > mHigherThresh ) mHigherThresh = mLowerThresh;
mParticleController.applyForceToPredators( mZoneRadius, 0.4f, 0.7f );
mParticleController.applyForceToParticles( mZoneRadius, mLowerThresh, mHigherThresh, mAttractStrength, mRepelStrength, mOrientStrength );
if( mCentralGravity ) mParticleController.pullToCenter( mCenter );
mParticleController.update( mFlatten );
mEye = Vec3f( 0.0f, 0.0f, mCameraDistance );
mCam.lookAt( mEye, mCenter, mUp );
gl::setMatrices( mCam );
gl::rotate( mSceneRotation );
}
示例9: update
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();
}
}
示例10: update
void TutorialApp::update()
{
if( ! mChannel ) return;
if( mIsPressed )
mParticleController.addParticles( NUM_PARTICLES_TO_SPAWN, mMouseLoc, mMouseVel );
// mParticleController.repulseParticles();
if( mCentralGravity )
mParticleController.pullToCenter();
if( mAllowPerlin )
mParticleController.applyPerlin( mPerlin );
mParticleController.update( mChannel, mMouseLoc );
}
示例11: renderSceneToFbo
void syphonImpApp::renderSceneToFbo()
{
// this will restore the old framebuffer binding when we leave this function
// on non-OpenGL ES platforms, you can just call mFbo.unbindFramebuffer() at the end of the function
// but this will restore the "screen" FBO on OpenGL ES, and does the right thing on both platforms
gl::SaveFramebufferBinding bindingSaver;
// bind the framebuffer - now everything we draw will go there
myFbo.bindFramebuffer();
gl::setViewport(myFbo.getBounds() );
gl::setMatricesWindow( myFbo.getSize(), false );
// clear out the FBO with blue
gl::clear();
mParticleController.update();
mParticleController.draw();
}
示例12: update
void TutorialApp::update()
{
// Stop repulsing for now.
//mParticleController.repulseParticles();
// UPDATE CAMERA
mEye = Vec3f( 0.0f, 0.0f, mCameraDistance );
mCam.lookAt( mEye, mCenter, mUp );
gl::setMatrices( mCam );
gl::rotate( mSceneRotation );
// UPDATE PARTICLE CONTROLLER
mParticleController.applyForce( mZoneRadius * mZoneRadius, mThresh );
if( mCentralGravity ) mParticleController.pullToCenter( mCenter );
mParticleController.update( mFlatten );
}
示例13: 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());
}
}
示例14: update
void JtChapterOneApp::update()
{
if( ! mChannel ) return;
myPController.update( mChannel );
}
示例15: setFullScreen
void PixarDemo2012::update()
{
if ( mFullScreen != isFullScreen() ) {
setFullScreen(mFullScreen);
// mCamera->setAspectRatio(getWindowAspectRatio());
// mySurface = cairo::SurfaceImage(getWindowWidth(),getWindowHeight(),true);
if ( isFullScreen() == true ) {
hideCursor();
} else {
showCursor();
}
}
mTime += 0.01f;
float kFudge = 0.1; // ten times our step
if(mAutoCut && mTime > mCuts[mCurrentCut] && mTime < mCuts[mCurrentCut] + kFudge )
{
doFade = true;
mCurrentCut = mCurrentCut + 1;
if(mCurrentCut >= mCuts.size())
{
mCurrentCut = mCuts.size()-1;
}
}
mParticleController.update();
if ( drawTitle ) {
theTitle.Update();
}
if ( drawCloth ) {
theCloth.Update( );
}
if ( drawCubes ) {
theCubes.Update();
}
if ( drawMindField ) {
theMindField.Update();
}
// Check if track is playing and has a PCM buffer available
if ( mTrack->isPlaying() && mTrack->isPcmBuffering() ) {
// Get buffer
mBuffer = mTrack->getPcmBuffer();
if ( mBuffer && mBuffer->getInterleavedData() ) {
// Get sample count
uint32_t sampleCount = mBuffer->getInterleavedData()->mSampleCount;
if ( sampleCount > 0 ) {
// Initialize analyzer
if ( !mFft ) {
mFft = Kiss::create( sampleCount );
}
// Analyze data
if ( mBuffer->getInterleavedData()->mData != 0 ) {
mFft->setData( mBuffer->getInterleavedData()->mData );
}
}
}
}
}