fix for actor setLOD

This commit is contained in:
Zachary Pavlov 2009-05-07 18:56:33 +00:00
parent ffd836e3b1
commit 3fcd2a764e

View File

@ -700,9 +700,13 @@ class Actor(DirectObject, NodePath):
# add the switch distance info
## sortedKeys = self.switches.keys()
## sortedKeys.sort()
sortedKeys = self.__sortedLODNames
index = sortedKeys.index(str(lodName))
self.__LODNode.node().setSwitch(index, inDist, outDist)
self.__LODNode.node().setSwitch(self.getLODIndex(lodName), inDist, outDist)
def getLODIndex(self, lodName):
"""getLODIndex(self)
safe method (but expensive) for retrieving the child index
"""
return list(self.__LODNode.getChildren()).index(self.getLOD(lodName))
def getLOD(self, lodName):
"""getLOD(self, string)