mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
*** empty log message ***
This commit is contained in:
parent
c612bc0e52
commit
47e1a235ac
@ -152,6 +152,7 @@ class ClientRepository(DirectObject.DirectObject):
|
||||
# Assign it an Id
|
||||
distObj.doId = doId
|
||||
# Update the required fields
|
||||
distObj.generateInit() # Only called when constructed
|
||||
distObj.generate()
|
||||
distObj.updateRequiredFields(cdc, di)
|
||||
# Put the new do in both dictionaries
|
||||
@ -190,6 +191,7 @@ class ClientRepository(DirectObject.DirectObject):
|
||||
self.doId2do[doId] = distObj
|
||||
self.doId2cdc[doId] = cdc
|
||||
# Update the required fields
|
||||
distObj.generateInit() # Only called when constructed
|
||||
distObj.generate()
|
||||
distObj.updateRequiredOtherFields(cdc, di)
|
||||
# Put the new do in both dictionaries
|
||||
|
@ -50,6 +50,12 @@ class DistributedObject(PandaObject):
|
||||
"""
|
||||
pass
|
||||
|
||||
def generateInit(self):
|
||||
"""generateInit(self)
|
||||
This method is called when the DistributedObject is first introduced
|
||||
to the world... Not when it is pulled from the cache.
|
||||
"""
|
||||
|
||||
def getDoId(self):
|
||||
"""getDoId(self)
|
||||
Return the distributed object id
|
||||
|
@ -44,9 +44,33 @@ class EventInterval(FunctionInterval):
|
||||
# Create function interval
|
||||
FunctionInterval.__init__(self, sendFunc, name = event)
|
||||
|
||||
### FunctionInterval subclass for accepting hooks ###
|
||||
class AcceptInterval(FunctionInterval):
|
||||
# Initialization
|
||||
def __init__(self, dirObj, event, function, name):
|
||||
"""__init__(dirObj, event, function, name)
|
||||
"""
|
||||
def acceptFunc(dirObj = dirObj, event = event, function = function):
|
||||
print "accepting..."
|
||||
dirObj.accept(event, function)
|
||||
# Create function interval
|
||||
FunctionInterval.__init__(self, acceptFunc, name = name)
|
||||
|
||||
### FunctionInterval subclass for throwing events ###
|
||||
class IgnoreInterval(FunctionInterval):
|
||||
# Initialization
|
||||
def __init__(self, dirObj, event, name):
|
||||
"""__init__(dirObj, event, name)
|
||||
"""
|
||||
def ignoreFunc(dirObj = dirObj, event = event):
|
||||
print "ignoring..."
|
||||
dirObj.ignore(event)
|
||||
# Create function interval
|
||||
FunctionInterval.__init__(self, ignoreFunc, name = name)
|
||||
|
||||
### Function Interval subclass for adjusting scene graph hierarchy ###
|
||||
class ParentInterval(FunctionInterval):
|
||||
# PosInterval counter
|
||||
# ParentInterval counter
|
||||
parentIntervalNum = 1
|
||||
# Initialization
|
||||
def __init__(self, nodePath, parent, name = None):
|
||||
@ -61,6 +85,23 @@ class ParentInterval(FunctionInterval):
|
||||
# Create function interval
|
||||
FunctionInterval.__init__(self, reparentFunc, name = name)
|
||||
|
||||
### Function Interval subclass for adjusting scene graph hierarchy ###
|
||||
class WrtParentInterval(FunctionInterval):
|
||||
# WrtParentInterval counter
|
||||
wrtParentIntervalNum = 1
|
||||
# Initialization
|
||||
def __init__(self, nodePath, parent, name = None):
|
||||
"""__init__(nodePath, parent, name)
|
||||
"""
|
||||
def wrtReparentFunc(nodePath = nodePath, parent = parent):
|
||||
nodePath.wrtReparentTo(parent)
|
||||
# Determine name
|
||||
if (name == None):
|
||||
name = 'WrtParentInterval-%d' % WrtParentInterval.wrtParentIntervalNum
|
||||
WrtParentInterval.wrtParentIntervalNum += 1
|
||||
# Create function interval
|
||||
FunctionInterval.__init__(self, wrtReparentFunc, name = name)
|
||||
|
||||
### Function Interval subclasses for instantaneous pose changes ###
|
||||
class PosInterval(FunctionInterval):
|
||||
# PosInterval counter
|
||||
|
Loading…
x
Reference in New Issue
Block a user