Sign in to follow this  
AbsolutDew

Particles and emitters in scene graphs

Recommended Posts

I have a basic scene graph and a class called ParticleEmitter. ParticleEmitter stores the emitted particles as children. The problem is that the child particles move with the emitter when really they should be transformed in world space instead. I have a couple possible solutions but I don't have much experience so I'm hoping someone can help me decide how to approach the problem and maybe improve the flexibility of my scene graph in the process. What I've thought of so far involves adding a bunch of flags to my node class like useDerivedPosition, useDerivedPosition, etc. I also considered overriding my WorldTransform method to just return LocalTransform. They both seem kinda messy to me and looking over the scene graphs in various open source engines I don't see anything equivalent, so I assume there's a less intrusive way to go about things. And before anyone points it out, I'm aware having each particle as a seperate node is not very efficient :) but it's simple to represent and think about, and I'm all about keeping things as simple as possible at this point. [edit] I see OGRE has some sort of flag for using derived scale so I guess that approach isn't completely unheard of. [Edited by - AbsolutDew on October 8, 2006 9:46:41 PM]

Share this post


Link to post
Share on other sites
Hack 1 (quick): Set the velocity of the particles to the inverse of the velocity of the emitter.

Hack 2: Separate node transform and instance transform. So, node transform builds the transform hierarchy (node transform will be applied to node and children). Instance transform will only be applied to the entity which is linked to the node, not the children.

Both are IMHO not very good solutions, but should work in most cases.

Real solution: Do not make particles separate nodes ;-)

EDIT:

Another solution: let the particles just do NOT USE the world transform. Create the particle using a world position. The render method of the particle should just ignore the world transform. If you have a kind of virtual render method in your instances, then it should be possible without any modifications of the scene graph.

Share this post


Link to post
Share on other sites

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

Sign in to follow this