Video shows 1000 particles, emit rate 100 every 5 seconds and at death it sets each particles gravity to 0. Not sure what this feature could be used for but I just thought it would be cool to have :-)
[media='640x360']
[/media]
// ################################
// Test Particle system
asset_bs = new lsAsset_BulletShape( vortxge->getAsset_manager() );
asset_bs->Make_Box( 0.5, 0.5, 0.5 );
vortxge->getAsset_manager()->Add_Asset( "bullet/particlebox", asset_bs );
lsParticleEmitter *pe;
pe = new lsParticleEmitter( 1000, vortxge->getOpenGL(), demo_scene );
if( pe )
{
pe->position = lsVector3( 0.0, 25.0, 0.0 );
pe->setDeath_type( LSDT_PARTICLE_GRAVITY );
pe->Set_EmitRate( 100, 5*1000, 10*1000 );
pe->Set_Volume( 20.0, 5.0, 20.0 );
// Add light
demo_scene->setFoundNode(0);
demo_scene->Find_Node( demo_scene, "Spot" );
if( demo_scene->getFoundNode() )
{
lsLight *light = (lsLight*)demo_scene->getFoundNode();
pe->Add_Light( light );
}
// Set mesh
lsAsset_Mesh *amesh;
amesh = (lsAsset_Mesh*)vortxge->getAsset_manager()->Find_Asset( LSAT_MESH, "data/vbm/Cube.vbm" );
if( amesh )
{
pe->mesh = amesh->getMesh();
}
pe->Init( 1.5, asset_bs, demo_scene );
demo_scene->Add_Node( pe );
}