Re: A couple of simple pointer questions (targets, arrays of pointers)



Joost wrote:
2.) Is there any way to make an array of pointers to triangles (to
handle the adjacent triangles), rather than an array of wrapper objects
that contain pointers to triangles?

No, you need the wrapper object to make the array of pointers. However,
you could, instead of using pointers for making connections, also use
integers, which would just be the location of the triangle in a
preallocated array of triangles.

Yeah, the more I think about this, the more that seems like the right way to go -- the deciding factor was that I'm storing all the data in an array indexed by the triangle number, so I pretty much either need to have the integers anyway, or need to completely rethink the storage model.

Thanks for the suggestions about declaring the triangles as pointers in the mesh object and then allocating them, though; I'm sure I'll use that sometime.

- Brooks


--
The "bmoses-nospam" address is valid; no unmunging needed.
.



Relevant Pages