🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

vortxGE 2.0 particles

Published February 29, 2012
Advertisement
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]
Previous Entry vortxGE 2.0 : Design
2 likes 2 comments

Comments

Programming020195BRook
That's a lot of particles!!! Nice physics too!
March 01, 2012 05:49 AM
mixmaster
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.
March 02, 2012 03:58 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

vortxGE : Threads

2452 views

C++11 Threads

3150 views

My Business

2305 views

Still Alive

2116 views

vortxEDIT : video

2236 views

vortxGE : Update

6078 views

vortxEDIT : Save

1995 views
Advertisement