|
From: Roger H. <rog...@mi...> - 2007-02-15 19:21:00
|
>>> In the renderers, I'm using a custom element to cache an optimized >>> version of a TriMesh. The element contains an edit index along >>> with the >>> TriMesh reference, so that a stale cache can be detected. That >>> works >>> fine in principle, though there's a bug at the moment. >>> >>> But now suppose I have another similar custom element, say to >>> cache a >>> triangle strip. When I update the triangle strip, it bumps the edit >>> index, so the other cache becomes stale. Which causes the other >>> cache >>> to get updated, bumping the edit index, which makes the triangle >>> cache >>> stale... >>> >>> How can I get out of this infinite loop? The simplest way, I >>> suppose, >>> would be to add a Q3Shared_SetEditIndex function, and use it when >>> setting these cache elements. Is there a more elegant way I haven't >>> thought of? >>> -- >> >> >> I don't exactly understand what you are trying to do. You have an >> object A >> which has two caches B and C, both of which hold the edit index of A. >> Why would updating B or C update the edit index of A? > > Because B and C are custom elements, and Q3Object_AddElement and > Q3Shape_AddElement update the edit index. > >> Or is C a cache of B? If so, C holds the edit indexes of A and B. > > Elements don't even have edit indexes, only shared objects do. I see. Would a Q3Shared_DecrementEditIndex be very slightly less dangerous? Roger |