I'm currently building a particle engine, with each particle having a unique set of 'constraints'.
Where a constraint is say, can not go off the screen, or cap the velocity to X.
These constraints would be set at compile time, and can not change.
I believe that the Decorator pattern could be applied here, however my understanding is that this is for more for changing constraints during run-time, and also would be quite performance taxing. What other alternatives are there?
Aucun commentaire:
Enregistrer un commentaire