[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Fastest (x,y) distance calculation
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[Zak Arntson]:
> [...]
> I investigated BSP trees, but it looks like it would be difficult to
> maintain them on the fly for a large number of moving objects. For the
> static Temples, it's no problem. But I eventually want to have up to 100
> (or more, if I can optimize properly) moving objects that each know who
> the nearest object is.
>
> Or are BSP trees the way to go?
> [...]
You could try building a Voronoi map. That way you only have to store a convex
polygonal region for each temple, and find the polygon in which the object is
contained.
[]s,
- --
Fábio "ctg \pi" Dias Moreira
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/YePZalOQFrvzGQoRAuVSAKCpeJqta28CGjHFOblI9PXoVULuwQCgs9bT
cJ8HbbAi5A92U7BrwB922HY=
=NekI
-----END PGP SIGNATURE-----