vortxGE 2.0 Particles 2

Published March 15, 2012
Advertisement
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 :-)


[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 );

}

1 likes 7 comments

Comments

mixmaster
I was still having an issue with hiding particles before they were reset to spawn point, they still reacted with other particles, so I added this callback to my bullet world.

[Code]
bool lsFilterCallback::needBroadphaseCollision( btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1 ) const
{
bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;
collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);

//add some additional logic here that modifies 'collides'
btCollisionObject* obA = static_cast<btCollisionObject*>(proxy0->m_clientObject);
btCollisionObject* obB = static_cast<btCollisionObject*>(proxy1->m_clientObject);

// Get Scene nodes
lsNode *obj_A = (lsNode*)obA->getUserPointer();
lsNode *obj_B = (lsNode*)obB->getUserPointer();
if(( obj_A )&&( obj_B ))
{
switch( obj_A->getNode_type() )
{
case LSNT_PARTICLE:
// check physics disabled
if( obj_A->getHide() ) collides = false;
break;
}
switch( obj_B->getNode_type() )
{
case LSNT_PARTICLE:
// check physics disabled
if( obj_B->getHide() ) collides = false;
break;
}

/* Debug
cout << "Object A : ";
cout << obj_A->getName();
cout << " - hit Object B : ";
cout << obj_B->getName();
cout << endl;
*/
}
return collides;
}
[/Code]

I basically check both Nodes to see if one has Hide set to true, if so return false to ignore collision.
I also do other things to make sure the particle doesn't render etc..
March 15, 2012 01:15 PM
Programming020195BRook
I would hate to be under all those falling blocks!

Looking superb as always!
March 20, 2012 04:49 AM
mixmaster
LOL, it is a little annoying if you get stuck in the middle of them all, cant move... I really need to make something useful with this engine soon :-)

Any Game Designers starting out want a new engine to play with, drop me a message.
March 20, 2012 12:01 PM
Programming020195BRook
I would love to toy around with it, just playing 3 games of hockey a week. -.- Keep working on this though, my offer to use it still stands! :)
March 23, 2012 05:36 AM
mixmaster
Hey man, your in for sure... But you should finish what you started first. And if you want any help I'm ready to put my hand up... Never discard anything your working on. Your game concept is sound and may make more money then other apps out there.

I'd work with you any day..

I've been watching your progress, and you have passion. no degree can even come close.

Really tell me when your ready and contact me.
March 23, 2012 02:13 PM
Programming020195BRook
Thanks, I appreciate that. I'm far from done my game, and believe me... I wont be quitting this project!

Keep up the great work as well!!!
March 26, 2012 05:22 AM
mixmaster
Great to hear! Oh I've come to far to stop now :-)
March 26, 2012 01:24 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

vortxGE : Threads

2320 views

C++11 Threads

3024 views

My Business

2178 views

Still Alive

2009 views

vortxEDIT : video

2121 views

vortxGE : Update

5972 views

vortxEDIT : Save

1878 views
Advertisement