
Nathan Hüsken
[...]
But now the collisions are generated at one place, and processed at another. This means that CollData must be somehow tagged to the objects it belongs to (an ID for example). This again means that some function must take the pool of all collision datas and distribute them to the "object" Signals.
When I have a lot of objects, this means a significant overhead!
Now I am wondering if there is a nicer approach which avoids this overhead.
You can get around the overhead by letting the objects do the collisions themselves, much like in your OOP variant. For instance in Netwire you could have this: planets :: MyWire [Planet] Planet This naive way still causes the overhead of lists and a planet distinguishing between others and itself. But now this is simply a matter of choosing proper data structures and starting to identify planets: type PlanetSet = Map PlanetId Planet planets :: MyWire PlanetSet (PlanetId, Planet) This looks more promising. Now the last thing is that this looks like a chicken/egg problem, but it's easy to resolve using ArrowLoop and one-instant delays. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife >>= sex) http://ertes.de/