Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Movable struct, how to keep reference to it

$
0
0
I have a SOA particle buffer, that I'm accessing by an index (I build a temp class which has references to the vectors inside the arrays). When particles die, I collapse the structure, copying particles to keep a continues array of data. Now, for some cases, an emitter would need to keep a reference (basically an index) or a handle of some sort to a specific particle (parent particle, sub emitter relationship). Any ideas how to nicely/fast do that? Preferably I would like to have a bi-directional link, at the moment, particles keep a list of affected emitter(s), which works in a way, but I need to do a dirty way of checking if emitter is still valid. Any ideas would be appreciated.

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>