mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
allow passing in an LODNode to the constructor
This commit is contained in:
parent
9433b488ec
commit
5d9ded7299
@ -22,7 +22,8 @@ class Actor(DirectObject, NodePath):
|
|||||||
LoaderOptions.LFReportErrors |
|
LoaderOptions.LFReportErrors |
|
||||||
LoaderOptions.LFConvertAnim)
|
LoaderOptions.LFConvertAnim)
|
||||||
|
|
||||||
def __init__(self, models=None, anims=None, other=None, copy=1):
|
def __init__(self, models=None, anims=None, other=None, copy=1,
|
||||||
|
lodNode = None):
|
||||||
"""__init__(self, string | string:string{}, string:string{} |
|
"""__init__(self, string | string:string{}, string:string{} |
|
||||||
string:(string:string{}){}, Actor=None)
|
string:(string:string{}){}, Actor=None)
|
||||||
Actor constructor: can be used to create single or multipart
|
Actor constructor: can be used to create single or multipart
|
||||||
@ -129,7 +130,7 @@ class Actor(DirectObject, NodePath):
|
|||||||
# if this is a dictionary of dictionaries
|
# if this is a dictionary of dictionaries
|
||||||
if (type(models[models.keys()[0]]) == type({})):
|
if (type(models[models.keys()[0]]) == type({})):
|
||||||
# then it must be a multipart actor w/LOD
|
# then it must be a multipart actor w/LOD
|
||||||
self.setLODNode()
|
self.setLODNode(node = lodNode)
|
||||||
# preserve numerical order for lod's
|
# preserve numerical order for lod's
|
||||||
# this will make it easier to set ranges
|
# this will make it easier to set ranges
|
||||||
sortedKeys = models.keys()
|
sortedKeys = models.keys()
|
||||||
@ -150,7 +151,7 @@ class Actor(DirectObject, NodePath):
|
|||||||
self.loadModel(models[partName], partName, copy = copy)
|
self.loadModel(models[partName], partName, copy = copy)
|
||||||
else:
|
else:
|
||||||
# it is a single part actor w/LOD
|
# it is a single part actor w/LOD
|
||||||
self.setLODNode()
|
self.setLODNode(node = lodNode)
|
||||||
# preserve order of LOD's
|
# preserve order of LOD's
|
||||||
sortedKeys = models.keys()
|
sortedKeys = models.keys()
|
||||||
sortedKeys.sort()
|
sortedKeys.sort()
|
||||||
@ -461,10 +462,9 @@ class Actor(DirectObject, NodePath):
|
|||||||
If one is not supplied as an argument, make one
|
If one is not supplied as an argument, make one
|
||||||
"""
|
"""
|
||||||
if (node == None):
|
if (node == None):
|
||||||
lod = LODNode("lod")
|
node = LODNode("lod")
|
||||||
self.__LODNode = self.__geomNode.attachNewNode(lod)
|
|
||||||
else:
|
self.__LODNode = self.__geomNode.attachNewNode(node)
|
||||||
self.__LODNode = self.__geomNode.attachNewNode(node)
|
|
||||||
self.__hasLOD = 1
|
self.__hasLOD = 1
|
||||||
self.switches = {}
|
self.switches = {}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user