|
From: James W. W. <os...@jw...> - 2007-02-14 16:31:22
|
On Feb 14, 2007, at 2:57 AM, Roger Holmes wrote: > > On 13 Feb, 2007, at 23:49, James Walker wrote: > >> 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. |