本文整理汇总了C++中ParticleController类的典型用法代码示例。如果您正苦于以下问题:C++ ParticleController类的具体用法?C++ ParticleController怎么用?C++ ParticleController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ParticleController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Factory
//----------------------------------------------------------------------------
// streaming
//----------------------------------------------------------------------------
Object* ParticleController::Factory (Stream& rkStream)
{
ParticleController* pkObject = new ParticleController;
Stream::Link* pkLink = new Stream::Link(pkObject);
pkObject->Load(rkStream,pkLink);
return pkObject;
}
示例2: getWindowWidth
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();
}
示例3: update
void TutorialApp::update()
{
if( ! mChannel ) return;
if( mIsPressed )
mParticleController.addParticles( NUM_PARTICLES_TO_SPAWN, mMouseLoc, mMouseVel );
mParticleController.update( mPerlin, mChannel, mMouseLoc );
}
示例4:
void chapter3App::update()
{
if (! mChannel ) return;
if( mIsPressed )
mParticleController.addParticles( 5, mMouseLoc, mMouseVel );
mParticleController.update(perlin, mChannel, mMouseLoc );
}
示例5: vec3
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: Vec3f
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 );
}
示例7: 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 );
}
示例8: 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();
}
}
示例9: url
void TutorialApp::setup()
{
Url url( "http://www.libcinder.org/media/tutorial/paris.jpg" );
mImage = gl::Texture( loadImage( loadUrl( url ) ) );
mParticleController.addParticles( 250 );
}
示例10: vec3
void Day57App::setup()
{
Rand::randomize();
mCenter = vec3(getWindowWidth() * 0.5f, getWindowHeight() * 0.5f, 0.0f);
mCentralGravity = false;
mFlatten = false;
mSaveFrames = false;
mIsRenderingPrint = false;
mZoneRadius = 80.0f;
mLowerThresh = 0.5f;
mHigherThresh = 0.8f;
mAttractStrength = 0.004f;
mRepelStrength = 0.01f;
mOrientStrength = 0.01f;
// SETUP CAMERA
mCameraDistance = 350.0f;
mEye = vec3(0.0f, 0.0f, mCameraDistance);
mCenter = vec3(0.);
mUp = vec3(0., 1., 0.);
// mCam.lookAt(vec3(0.,0.,20.), vec3(0.));
mCam.setPerspective(75.0f, getWindowAspectRatio(), 5.0f, 5000.0f);
// CREATE PARTICLE CONTROLLER
mParticleController.addParticles(NUM_INITIAL_PARTICLES);
}
示例11: Color
void TutorialApp::draw()
{
if(isFirst) {
gl::clear( Color( 0, 0, 0 ), true );
isFirst = false;
}
gl::enableAlphaBlending();
if( mDrawImage ){
mTexture.enableAndBind();
gl::draw( mTexture, getWindowBounds() );
}
// if( mDrawParticles ){
glDisable( GL_TEXTURE_2D );
mParticleController.draw();
// }
if( mDrawImage ){
mOverlay.enableAndBind();
gl::draw( mOverlay, getWindowBounds() );
}
// if( mSaveFrames ){
// writeImage( getHomeDirectory() / ( "image_" + toString( getElapsedFrames() ) + ".png" ), copyWindowSurface() );
// }
}
示例12: Color
void TutorialApp::draw()
{
gl::clear( Color( 0, 0, 0 ), true );
gl::enableDepthRead();
gl::enableDepthWrite();
// DRAW PARTICLES
mParticleController.draw();
// DRAW ZONE DIAGRAM
gl::disableDepthRead();
gl::disableDepthWrite();
gl::setMatricesWindow( getWindowSize() );
gl::pushModelView();
gl::translate( Vec3f( 117.0f, getWindowHeight() - 117.0f, 0.0f ) );
gl::color( ColorA( 1.0f, 0.25f, 0.25f, 1.0f ) );
gl::drawSolidCircle( Vec2f::zero(), mZoneRadius );
gl::color( ColorA( 0.25f, 0.25f, 1.0f, 1.0f ) );
gl::drawSolidCircle( Vec2f::zero(), mThresh * mZoneRadius );
gl::color( ColorA( 1.0f, 1.0f, 1.0f, 0.25f ) );
gl::drawStrokedCircle( Vec2f::zero(), 100.0f );
gl::popModelView();
// DRAW PARAMS WINDOW
params::InterfaceGl::draw();
}
示例13: ParticleController
void Path2dApp::setup(){
thread.setup();
controller = new ParticleController();
controller->setup();
mPerlin = Perlin();
mImage = gl::Texture( loadImage( loadResource( "header.png" ) ) );
}
示例14: 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 );
}
示例15: keyDown
void FlockingApp::keyDown( KeyEvent event )
{
if( event.getChar() == 'p' ){
mParticleController.addParticles( NUM_PARTICLES_TO_SPAWN );
} else if( event.getChar() == ' ' ){
mSaveFrames = !mSaveFrames;
}
}