Mantis - Croquet
Viewing Issue Advanced Details
864 Jasmine tweak always 02-04-05 21:55 02-04-05 21:55
0000864: TMesh >> extent should only recalculate the extent if the mesh has been modified.
Perhaps this improvement belongs in TGroup or some other class than TMesh, i'm not sure.

My collision detection code calls TAvatar >> extent fairly often (at least once per avatar per collision candidate per frame). With only a handful of collision objects and a very fast computer, this knocks the framerate down from 48Hz to 12Hz! I put in a simple modification to TAvatar to just store its extent and only recalculate it every N requests (N=1000), and with this modification the frame rate is rock steady at 48Hz.

However, recalculating every 1000 requests is a shoddy solution, it should recalculate *if it's changed* since the last request, which i'll look at implementing, altho i think someone more familiar with the architecture would probably do a better job.

Thanks to Bert's Blog for pointing out the MessageTally profiler, which singled out this problem immediately.

There are no notes attached to this issue.