本文整理汇总了C++中ParticleController::pullToCenter方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleController::pullToCenter方法的具体用法?C++ ParticleController::pullToCenter怎么用?C++ ParticleController::pullToCenter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleController
的用法示例。
在下文中一共展示了ParticleController::pullToCenter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: 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 );
}
示例3: 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 );
}
示例4: 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 );
}
示例5: 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 );
}