[ODE] Trimesh Temporal Coherence Patches

Aras Pranckevicius nearaz at interamotion.com
Sun Dec 7 18:22:36 MST 2003


> In fact, from a read of the collision_trimesh_box.cpp code
> it looks as if geoms are entered by pointer into the TCCache,
> which would cause not only the little incremetal memory wastage

Yes, but it adds an ever-growing pointer array to each trimesh anyway :) In 
some cases (eg. you create/destroy lots of bullets) even pointer arrays can 
get big - but then the linear search probably will be a bigger problem. Of 
course, you can call TC clear functions manually, but...

> you mention but also some really unpredictable behaviour and/or
> crashes if those geoms are freed or re-used later.

Hoping for the best, it shouldn't crash :) TC cache is only searched for a 
matching pointer of "current colliding" geom - so dead geoms just have 
pointers to them, but aren't actually ever used. If geoms are RE-used, then I 
think Opcode internally does some checks - but my memory might be wrong.


> So, how would people feel if I disable temporal coherence by
> default?  Unless I'm mis-reading the code (i.e. not finding the
> code that lets, say, a box remember all of the mesh TCCaches it's
> in so it can notify them when it's destroyed, or a refcount)

I haven't found any place of observer-like behavior either. Personally I just 
insert remove whole TC check directly from colliding function :) TC is a good 
thing, but the current implementation should really be made optional.


Aras Pranckevicius aka NeARAZ
http://www.gim.ktu.lt/nesnausk/nearaz/



More information about the ODE mailing list