That is pretty much the idea, yes. In some cases, you can even use the array
as the partioning tree, but those are pretty special cases. The only problem
with
using an offset to an index is the growth factor that you hit if you overrun
your
allocated array. I recommend allocating a large enough array to suit your needs
so this doesn't happen. While you become slightly memory dependent, your speed
increases quite a bit and the locality of your nodes is maintained for purposes
of GC.
There are loads of optimizations. If you think you'd like to go the path of
nit-picking
let me know (contact through my blog), and we can do something over email with
our probably different implementations.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog:
http://weblogs.asp.net/justin_rogers [quoted text, click to view] "Morten Nielsen" <spam@iter.dk> wrote in message
news:c3ruuv$q5c$1@news.net.uni-c.dk...
> "Justin Rogers" <Justin@games4dotnet.com> wrote in message
> news:usybNDVEEHA.3040@TK2MSFTNGP12.phx.gbl...
> > Morten, I'm not quite done with the optimized BSP tree that I'm working
> on,
> > but you can use array indices instead of pointers. Sorry I can't be more
> > forthcoming with information on how to make this modification and have it
> > work appropriately. Hopefully I'll have the code done shortly and can
> simply
> > reference it.
>
> I think I know what you mean, but I'm not quite sure on what that would
> help, or else I didn't understand you.
>
> Instead of "public Face[] obj;" in the class, you would want a "public int
> index;" ?
> ...where 'index' refers to the index in a Face[] list ?
>
> /Morten
>
>