Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

timmay314

Particle systems

This topic is 5323 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 working particle system using a particle class named CParticle and one that handles most of the stuff called. I''m going to have several different types of particles, so I need to know if I should make a different particle and particle system class for each or if I can reuse them somehow. How is this generally done?

Share this post


Link to post
Share on other sites
Advertisement
I wrote a general particle system class that loaded various settings (start/end scale/velocity/acceleration/colour/etc) and worked like that.

At present, I have implemented each system with specific classes as I''m giving the particle systems different behaviours.

When I get my scripting system working, I''ll have the particle system control the particles from a default class and use the scripting to control colour/motion etc.

Share this post


Link to post
Share on other sites
Although there are different ways, it''s always best to keep your code as clean as possible, so try to have only one generic class which supports almost all your needs, including winds, acceleratin, collision, color, ... Of course you can add some other features later. Just be careful, when you don''t need a special feature, don''t take use of it, in this way you can build up later on your last codes.


game/software developer/algorithm designer

Share this post


Link to post
Share on other sites
Would you then recommend having CParticle have a member variable thats an enum or something that says what type it is, then do a switch statement in the update method to do the appropriate update?

Share this post


Link to post
Share on other sites
quote:
Original post by timmay314
Would you then recommend having CParticle have a member variable thats an enum or something that says what type it is, then do a switch statement in the update method to do the appropriate update?
use polymorphism

Share this post


Link to post
Share on other sites
I''d heard that polymorphism was too slow for particle systems with lots of particles, but I suppose that the same performance hit would happen this way...

Share this post


Link to post
Share on other sites

  • 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!