Jump to content
  • Advertisement
Sign in to follow this  
AbsolutDew

Particles and emitters in scene graphs

This topic is 4365 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!