• entries
    88
  • comments
    105
  • views
    70412

vortxGE 2.0 particles

Sign in to follow this  
mixmaster

995 views

Back and already done some fun stuff.. I'm rewriting my shaders for version 330 so forgive the lighting !!

Added a new particle system that supports bullet physics or animation per particle. Material is shared so animation will effect every object. No billboards yet, I may make another scene node for billboard particles anyway for best performance.

User side code to create the particles.

// ################################
// 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, asset_bs, demo_scene, vortxge->getOpenGL(), demo_scene );
if( pe )
{
pe->position = lsVector3( 0.0, 25.0, 0.0 );

pe->Set_EmitRate( 100, 2*1000, 10*1000 );
pe->Set_Volume( 100.0, 10.0, 100.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();
}
demo_scene->Add_Node( pe );
}


[media]
[/media]
Sign in to follow this  


2 Comments


Recommended Comments

Thanks again ! I'm really having fun working on this, things are coming together nicely.
Sadly I cant take credit for the physics :-) I'm using the Bullet Physics lib. And all you see is still only running in one thread.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now