LOD turned upside down in P3D 1.6

Today I noticed that this code…

    self.subject = Actor.Actor(
        'lod0': "slim-panda-lod0.egg.pz",
        'lod1': "slim-panda-lod1.egg.pz",
        'lod2': "slim-panda-lod2.egg.pz",
        'lod3': "slim-panda-lod3.egg.pz",
        'jump': 'slim-anim-jump00.egg.pz',
    self.subject.setLOD('lod0', 5, 0)
    self.subject.setLOD('lod1', 10, 5)
    self.subject.setLOD('lod2', 40, 10)
    self.subject.setLOD('lod3', 999999, 40)

that works as expected in 1.5.4 as is, while the cam is approaching the model the LOD system choose correctly the model with higher polycount than the previous one and the contrary while the cam is going far from it, in 1.6 it works totally on a reverse logic, so that approaching the model the LOD choose the model with lower polygons than the former and so on.
Here there is the whole code including the models to play with.

Sheesh. We’ve had so many silly bugs in this area. I’ll look into it.


all right, here’s the fix

/cvsroot/panda3d/direct/src/actor/Actor.py,v <-- Actor.py
new revision: 1.217; previous revision: 1.216

We’ve moved entirely away from actor using sortedLODNames internally.
setLOD now uses getLODIndex to determine the appropriate switch to set.