Hierarchical particles.
When I was an adolescent I made 3d graphics engines a lot, so I'm probably remembering the object and transformation hierarchies they have, a little.
def update(self, ms):
for child in self.children:
child.update(ms)
self.pos +=
I think I'd like to figure out how to integrate a constant acceleration. There are also libraries for symbolic integration, I understand.
I guess for now I'll just write the same old thing.
def update(self, ms):
for child in self.children:
child.update(ms)
self.pos += self.vel * ms
self.vel += self.accel * ms
self.age += ms
---
Maybe it could be nice to write some code to transform between graphs and property matrices. Trying to keep the code small and abbreviated enough to consider using it.
I'm imagining maybe the properties of objects would refer to a matrix.
@property
def pos(self):
return self.prop_matrix[self.particle_index, 0:3]
Seems it could be helpful, if the code is reusable, to define a mapping between names and ranges of a property vector.
Let's think about how this could be used.
I could write the update function once on all the particles, if I used operators that broadcast over the particle index.
I'm wondering whether to have the index be the first or second dimension. I'm considering trying the first because the transformers library uses the first dimensions as batch dimensions.