|
|
|
|
|
by ladberg
1287 days ago
|
|
The problem sounds like you're doing O(N^2) calculations at every tick because each particle has to interact with every other particle. To make it faster you should keep some spatial datastructure so that you can query the other particles within a certain range of your current particle and just interact with those, ignoring the rest. The usual implementation is an octree or something similar. That said, N=100 should still be fast with the naive algorithm so I'd definitely move off the scripting language to something faster. |
|