Jump to content

  • Log In with Google      Sign In   
  • Create Account





vortxGE 2.0 Particles 2

Posted by Lee A. Stripp, 14 March 2012 · 158 views

Game Engine
  • vortxGE
  • vortxGE rewrite10
  • vortxGE rewrite9

I've been working on the particle system again, fixed some issues and added some new features.

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 :-)


http://youtu.be/0hKxQ9h5tOQ

        // ################################
        // 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 );
            
        }
      





October 2014 »

S M T W T F S
   1234
567891011
12131415161718
19202122 23 2425
262728293031 

Recent Comments

PARTNERS