Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: particle system sorting data  (Read 1007 times)

0 Members and 1 Guest are viewing this topic.

Tojmak

  • Newbie
  • *
  • Posts: 4
    • View Profile
particle system sorting data
« on: April 18, 2020, 05:38:13 pm »
Hello,
I'm creating particle system with possibility to create force waves which can push partcles away when colliding.  Particles are moving away from the point of my mouse click, and force waves are expanding as long as they are visible on the screen (after that they are just erased). I want to improve performance of my code so i am thinking about sorting particles in some way. Problem is that i don;t know how to sort them. For now i am checking every single particle if it is colliding with force wave (there may be more than one of it) and i really don't want to do that. Also i want to add that checking is executed in every main loop. So it would be awasome if it could be stopped after reach some point. Also i'm wondering if there is some great container for particles. Currently i am using vector of unique pointers of particle objects. If anyone can recommended something better i would really appreciate it.
« Last Edit: April 18, 2020, 05:42:49 pm by Tojmak »