mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
updated sorting algorithm for lods
This commit is contained in:
parent
da5afd76e7
commit
fdc9d8fd53
@ -554,6 +554,16 @@ class Actor(DirectObject, NodePath):
|
||||
def __updateSortedLODNames(self):
|
||||
# Cache the sorted LOD names so we dont have to grab them
|
||||
# and sort them every time somebody asks for the list
|
||||
if(self.__hasLOD):
|
||||
lodnode = self.__LODNode.node()
|
||||
switchRange = range(lodnode.getNumSwitches())
|
||||
switchList = [lodnode.getIn(x) for x in switchRange]
|
||||
nameList = [self.__LODNode.getChild(x).getName() for x in switchRange]
|
||||
sortedList = zip(switchList, nameList)
|
||||
sortedList.sort()
|
||||
self.__sortedLODNames = [x[1] for x in sortedList]
|
||||
return
|
||||
|
||||
self.__sortedLODNames = self.__partBundleDict.keys()
|
||||
# Reverse sort the doing a string->int
|
||||
def sortFunc(x, y):
|
||||
|
Loading…
x
Reference in New Issue
Block a user