Jump to content

  • Log In with Google      Sign In   
  • Create Account





vortxGE 2.0 particles

Posted by Lee A. Stripp, 29 February 2012 · 822 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 );
  }

http://youtu.be/zerLSMnqj3g




That's a lot of particles!!! Nice physics too!
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.

December 2014 »

S M T W T F S
 123456
78910111213
14151617181920
21 22 2324252627
28293031   

Recent Comments

PARTNERS