3 ms·
kd-Tree: http://en.wikipedia.org/wiki/Kd-tree http://en.wikipedia.org/wiki/Kd-tree I've not used an R-tree before, but from the Wikipedia description, it looks
by JabavuAdams 18y ago
kd-Tree: http://en.wikipedia.org/wiki/Kd-tree http://en.wikipedia.org/wiki/Kd-tree
I've not used an R-tree before, but from the Wikipedia description, it looks like it's for static point sets. Your chicken positions are dynamic, which could cause you to constantly rebuild the tree.
- iamwil 18y agoThanks for the suggestion. I've also had someone else suggest voronoi diagrams for dynamic points. Looking up quadtrees briefly, made me happen across this: http://www.cs.berkeley.edu/~demmel/cs267/lecture26/lecture26.html http://www.cs.berkeley.edu/~demmel/cs267/lecture26/lecture26... Apparently there are adaptive quadtrees that can be used. Go figure. It'll probably take a bit of time for me to sort through it all.
- JabavuAdams 18y agoYou could also try a collision library like OPCODE. I wonder whether there are already Lua bindings out there? Chipmunk physics is another open source project with simple collision acceleration.