mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
use the already sortedLODNames instead of sorting everytime
This commit is contained in:
parent
9aff32ab79
commit
0d3349bac0
@ -635,14 +635,16 @@ class Actor(DirectObject, NodePath):
|
|||||||
"""
|
"""
|
||||||
# make sure we don't call this twice in a row
|
# make sure we don't call this twice in a row
|
||||||
# and pollute the the switches dictionary
|
# and pollute the the switches dictionary
|
||||||
sortedKeys = self.switches.keys()
|
## sortedKeys = self.switches.keys()
|
||||||
sortedKeys.sort()
|
## sortedKeys.sort()
|
||||||
index = sortedKeys.index(lodName)
|
sortedKeys = self.__sortedLODNames
|
||||||
|
index = sortedKeys.index(str(lodName))
|
||||||
self.__LODNode.node().forceSwitch(index)
|
self.__LODNode.node().forceSwitch(index)
|
||||||
|
|
||||||
def printLOD(self):
|
def printLOD(self):
|
||||||
sortedKeys = self.switches.keys()
|
## sortedKeys = self.switches.keys()
|
||||||
sortedKeys.sort()
|
## sortedKeys.sort()
|
||||||
|
sortedKeys = self.__sortedLODNames
|
||||||
for eachLod in sortedKeys:
|
for eachLod in sortedKeys:
|
||||||
print "python switches for %s: in: %d, out %d" % (eachLod,
|
print "python switches for %s: in: %d, out %d" % (eachLod,
|
||||||
self.switches[eachLod][0],
|
self.switches[eachLod][0],
|
||||||
@ -686,9 +688,10 @@ class Actor(DirectObject, NodePath):
|
|||||||
# save the switch distance info
|
# save the switch distance info
|
||||||
self.switches[lodName] = [inDist, outDist]
|
self.switches[lodName] = [inDist, outDist]
|
||||||
# add the switch distance info
|
# add the switch distance info
|
||||||
sortedKeys = self.switches.keys()
|
## sortedKeys = self.switches.keys()
|
||||||
sortedKeys.sort()
|
## sortedKeys.sort()
|
||||||
index = sortedKeys.index(lodName)
|
sortedKeys = self.__sortedLODNames
|
||||||
|
index = sortedKeys.index(str(lodName))
|
||||||
self.__LODNode.node().setSwitch(index, inDist, outDist)
|
self.__LODNode.node().setSwitch(index, inDist, outDist)
|
||||||
|
|
||||||
def getLOD(self, lodName):
|
def getLOD(self, lodName):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user