Maybe it's nice to assume I already implemented a data structure.
Something I played with when an adolescent was simple particle systems.
Local updates:
# particle
def update(self, ms):
self.vel += self.accel * ms
self.pos += self.vel * ms
# container
def update(self, ms):
for particle in self.particles:
particle.update(ms)
Global updates:
def update(self, ms):
for particle in self.particles:
particle.vel += particle.accel * ms
particle.pos += particle.vel * ms
How could we apply graphs to it?
Maybe we could handle more particles at once by updating only those within a moving region. Would this use graphs? what would be needed ...
- each particle would have a time of last update
- the update function would use calculus
- updates would generate and destroy batches of particles based on lifetime
Seems more like lists than graphs. What if there are multiple windows? No, just makes multiple lists.
We'd better make the particles have a hierarchy of reference frames, to use a graph structure I suppose.
I'm happy I wrote the particle update code above. Quite hard for me.