[Bf-committers] Expanding the number of layers in Blender
Martin Poirier
theeth at yahoo.com
Tue Dec 18 20:58:35 CET 2007
--- Timothy Baldridge <tbaldridge at gmail.com> wrote:
> That's the nice thing about bit fields. You can have
> object on
> multiple layers. I'd recomend doing a bit field
> array, where each byte
> the array represents 8 layers. But still you will
> have to iterate over
> the entire array to see if the object should be
> drawn, where as now
> it's as simple as:
>
> if (objectmask & viewmask) {
> draw_object();
> }
>
> You will have to do this with a bitfield array:
>
> for (x = 0; x < bfsize; x++){
> if (objbf[x] & viewmask[x]) {
> draw_object();
> break;
> }
> }
If bfsize is constant, compilers will most likely
unroll that into nice fast code which would be faster
than using liked list to represent belonging to a
layer.
Martin
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
More information about the Bf-committers
mailing list