]> git.itanic.dy.fi Git - sdl-planets/commit
quadtree: Optimize distance calculation
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Tue, 19 Jul 2011 18:40:33 +0000 (21:40 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Tue, 19 Jul 2011 18:40:33 +0000 (21:40 +0300)
commit87dcb56224eb827fb014cdc5129197c887cb3fcc
tree04783c46be545a95224c3b5713e8262acbadffcf
parent3bc710987a74ec3b2c8245bfad5344796a56ad0e
quadtree: Optimize distance calculation

All of the distance values needed here are only used for comparing
between different distances. The actual distance itself is not used at
all. Thus, the distance calculation can be optimized by leaving out
all of the square root calculations and the end result is still the
same.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
quadtree.c