当前位置: 首页>>代码示例>>C++>>正文


C++ ParticleController类代码示例

本文整理汇总了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;
}
开发者ID:Steven0818,项目名称:Deform,代码行数:10,代码来源:WmlParticleController.cpp

示例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();
}
开发者ID:thoney,项目名称:matrixP-screensaver,代码行数:25,代码来源:matrixP.cpp

示例3: update

void TutorialApp::update()
{
	if( ! mChannel ) return;
	
	if( mIsPressed )
		mParticleController.addParticles( NUM_PARTICLES_TO_SPAWN, mMouseLoc, mMouseVel );
	
	mParticleController.update( mPerlin, mChannel, mMouseLoc );
}
开发者ID:williamchyr,项目名称:CinderExamples,代码行数:9,代码来源:TutorialApp.cpp

示例4:

void chapter3App::update()
{
    if (! mChannel ) return;
    
    if( mIsPressed )
        mParticleController.addParticles( 5, mMouseLoc, mMouseVel );
    
    mParticleController.update(perlin, mChannel, mMouseLoc );
}
开发者ID:jcehle,项目名称:cinder-test,代码行数:9,代码来源:chapter3App.cpp

示例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();
}
开发者ID:Drakesinger,项目名称:Cinder,代码行数:12,代码来源:FlockingApp.cpp

示例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 );
}
开发者ID:AKS2346,项目名称:Cinder,代码行数:13,代码来源:FlockingApp.cpp

示例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 );
}
开发者ID:ChadMcKinney,项目名称:Cinder,代码行数:14,代码来源:FlockingApp.cpp

示例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();
	}
}
开发者ID:flimshaw,项目名称:VideoPan,代码行数:15,代码来源:VideoPanApp.cpp

示例9: url

void TutorialApp::setup()
{
	Url url( "http://www.libcinder.org/media/tutorial/paris.jpg" );
	mImage = gl::Texture( loadImage( loadUrl( url ) ) );

	mParticleController.addParticles( 250 );
}
开发者ID:AaronMeyers,项目名称:Cinder,代码行数:7,代码来源:TutorialApp.cpp

示例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);
    
}
开发者ID:Craigson,项目名称:100days,代码行数:29,代码来源:Day57App.cpp

示例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() );
//	}
}
开发者ID:newshorts,项目名称:Examples,代码行数:28,代码来源:TutorialApp.cpp

示例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();
}
开发者ID:milesmeow,项目名称:cinder_projects,代码行数:29,代码来源:TutorialApp.cpp

示例13: ParticleController

void Path2dApp::setup(){
  thread.setup();
  controller = new ParticleController();
  controller->setup();
  mPerlin = Perlin();
  mImage = gl::Texture( loadImage( loadResource( "header.png" ) ) );
}
开发者ID:karenpeng,项目名称:io_prototype,代码行数:7,代码来源:bezierPathApp.cpp

示例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 );
}
开发者ID:newshorts,项目名称:Examples,代码行数:17,代码来源:TutorialApp.cpp

示例15: keyDown

void FlockingApp::keyDown( KeyEvent event )
{
	if( event.getChar() == 'p' ){
		mParticleController.addParticles( NUM_PARTICLES_TO_SPAWN );
	} else if( event.getChar() == ' ' ){
		mSaveFrames = !mSaveFrames;
	}
}
开发者ID:ChadMcKinney,项目名称:Cinder,代码行数:8,代码来源:FlockingApp.cpp


注:本文中的ParticleController类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。