本文整理汇总了C++中ParticleSystem::drawMode方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleSystem::drawMode方法的具体用法?C++ ParticleSystem::drawMode怎么用?C++ ParticleSystem::drawMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleSystem
的用法示例。
在下文中一共展示了ParticleSystem::drawMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
// Initialization: load and compile shaders, initialize camera(s), load models.
void init() {
GLuint particleSystemShader;
Screen *primScreen = Engine::instance()->mainScreen();
Scene *rootScene = Engine::instance()->rootScene();
particleSystemShader = Angel::InitShader( "shaders/vParticle2.glsl",
"shaders/fParticle2.glsl",
"shaders/gParticle.glsl",//"shaders/gParticle.glsl",
GL_TRIANGLES, GL_TRIANGLE_STRIP, 12 );
rootScene->shader( particleSystemShader );
primScreen->_camList.shader( particleSystemShader );
{
ParticleSystem *particleSystem = new ParticleSystem( numberOfParticles,
"emitter",
particleSystemShader );
particleSystem->setLifespan(8.0, 16.0);
//particleSystem->setVectorField( ParticleFieldFunctions::userSupplied ) ;
particleSystem->setVectorField( ParticleFieldFunctions::flame );
particleSystem->setColorFunc( ColorFunctions::flame ) ;
particleSystem->setEmitterRadius( 0.04 ) ;
particleSystem->setEmitterShape(PS_HEMI_D);
particleSystem->drawMode( GL_TRIANGLES ) ; // NEED THIS IF WE USE A GEOMETRY SHADER!
//particleSystem->setSlaughterHeight(0.2455);
//particleSystem->_trans._displacement.set(0.0, 0.25, 0.0);
//particleSystem->_trans._offset.set( 0.0, 0.2, 0.0 );
particleSystem->propagateOLD();
//particleSystem->fillSystemWithParticles();
rootScene->insertObject( particleSystem );
// PARTICLE SYSTEMS buffer() THEMSELVES
}
glClearColor( 0.0, 0.0, 0.0, 1.0 );
// if not using geo shader, we need this to render visible points
// glPointSize( 1.1 );
}