Re: improvement of index-calculation




"Eric Grange" <egrangeNO@xxxxxxxxxxxxxxx> schrieb
>
> > I think this is not possible because this is a
> > Getter mehtod for a property
> >
> > property Cells[const x,y,z:integer]:boolean
> > read GetVoxelFromXYZ
> > write SetVoxelFromXYZ;
>
> It's possible to use an array, a record or any type in getter/setter
> method for a property as long as these match the indexes for the
> property (you're not limited to native types).

Ok. Never needed something like this.

>
> If everywhere else in the code you manipulate coordinates as independant
> variables (as in "x,y,z:integer"), then there is no benefit to using a
> record or array here, but if you use something like xyz:TVector,
> then this would benefit here (and using a structure might benefit the
> rest of the code as well for the same reasons).

Ah. No in that case I don't have a "ready" vectormade Variable that holds
the values. The Cell-Items are accessed during ray-tracing and shading.
But I have to say, I have not written the shading code so I don't know
which is the best way to access the items from the view of the shading
algo.

thanks
Guenther




.