Panda3D
|
This specializes DistributedNode to add functionality to smooth motion over time, via the SmoothMover C++ object defined in DIRECT.
def __init__ | ( | self, | |
cr | |||
) |
Reimplemented from DistributedNode.
def __cmp__ | ( | self, | |
other | |||
) | [inherited] |
def activateSmoothing | ( | self, | |
smoothing, | |||
prediction | |||
) |
Enables or disables the smoothing of other avatars' motion. This used to be a global flag, but now it is specific to each avatar instance. However, see globalActivateSmoothing() in this module. If smoothing is off, no kind of smoothing will be performed, regardless of the setting of prediction. This is not necessarily predictive smoothing; if predictive smoothing is off, avatars will be lagged by a certain factor to achieve smooth motion. Otherwise, if predictive smoothing is on, avatars will be drawn as nearly as possible in their current position, by extrapolating from old position reports. This assumes you have a client repository that knows its localAvatarDoId -- stored in self.cr.localAvatarDoId
def addInterest | ( | self, | |
zoneId, | |||
note = "" , |
|||
event = None |
|||
) | [inherited] |
def announceGenerate | ( | self | ) | [inherited] |
Sends a message to the world after the object has been generated and all of its required fields filled in.
Reimplemented in TimeManager.
def b_clearSmoothing | ( | self | ) | [inherited] |
def b_setLocation | ( | self, | |
parentId, | |||
zoneId | |||
) | [inherited] |
def b_setParent | ( | self, | |
parentToken | |||
) | [inherited] |
setParent ###
def clearSmoothing | ( | self, | |
bogus = None |
|||
) |
def d_clearSmoothing | ( | self | ) | [inherited] |
def d_returnResync | ( | self, | |
avId, | |||
timestampB, | |||
serverTime, | |||
uncertainty | |||
) |
def d_setH | ( | self, | |
h | |||
) | [inherited] |
def d_setHpr | ( | self, | |
h, | |||
p, | |||
r | |||
) | [inherited] |
def d_setLocation | ( | self, | |
parentId, | |||
zoneId | |||
) | [inherited] |
def d_setP | ( | self, | |
p | |||
) | [inherited] |
def d_setParent | ( | self, | |
parentToken | |||
) |
Reimplemented from DistributedNode.
def d_setPos | ( | self, | |
x, | |||
y, | |||
z | |||
) | [inherited] |
def d_setPosHpr | ( | self, | |
x, | |||
y, | |||
z, | |||
h, | |||
p, | |||
r | |||
) | [inherited] |
def d_setR | ( | self, | |
r | |||
) | [inherited] |
def d_setX | ( | self, | |
x | |||
) | [inherited] |
set pos and hpr functions #######
def d_setXY | ( | self, | |
x, | |||
y | |||
) | [inherited] |
def d_setXYH | ( | self, | |
x, | |||
y, | |||
h | |||
) | [inherited] |
def d_setXYZH | ( | self, | |
x, | |||
y, | |||
z, | |||
h | |||
) | [inherited] |
def d_setXZ | ( | self, | |
x, | |||
z | |||
) | [inherited] |
def d_setY | ( | self, | |
y | |||
) | [inherited] |
def d_setZ | ( | self, | |
z | |||
) | [inherited] |
def d_suggestResync | ( | self, | |
avId, | |||
timestampA, | |||
timestampB, | |||
serverTime, | |||
uncertainty | |||
) |
Monitor clock sync ###.
def delete | ( | self | ) |
Inheritors should redefine this to take appropriate action on delete
Reimplemented from DistributedNode.
def deleteOrDelay | ( | self | ) | [inherited] |
def disable | ( | self | ) |
Inheritors should redefine this to take appropriate action on disable
Reimplemented from DistributedNode.
def disableAndAnnounce | ( | self | ) | [inherited] |
Inheritors should *not* redefine this function.
def disableAnnounceAndDelete | ( | self | ) | [inherited] |
def do_setParent | ( | self, | |
parentToken | |||
) | [inherited] |
do_setParent(self, int parentToken) This function is defined simply to allow a derived class (like DistributedAvatar) to override the behavior of setParent if desired.
def doCallbackContext | ( | self, | |
context, | |||
args | |||
) | [inherited] |
def doneBarrier | ( | self, | |
name = None |
|||
) | [inherited] |
def doSmoothTask | ( | self, | |
task | |||
) |
def execCommand | ( | self, | |
string, | |||
mwMgrId, | |||
avId, | |||
zoneId | |||
) | [inherited] |
def flushCachedData | ( | self, | |
name | |||
) | [inherited] |
def forceToTruePosition | ( | self | ) |
This forces the node to reposition itself to its latest known position. This may result in a pop as the node skips the last of its lerp points.
def generate | ( | self | ) |
Inheritors should redefine this to take appropriate action on generate
Reimplemented from DistributedNode.
def generateInit | ( | self | ) | [inherited] |
This method is called when the DistributedObject is first introduced to the world... Not when it is pulled from the cache.
def getAutoInterests | ( | self | ) | [inherited] |
def getBarrierData | ( | self | ) | [inherited] |
def getCacheable | ( | self | ) | [inherited] |
def getCachedData | ( | self, | |
name | |||
) | [inherited] |
def getCallback | ( | self, | |
context | |||
) | [inherited] |
def getCallbackArgs | ( | self, | |
context | |||
) | [inherited] |
def getCallbackContext | ( | self, | |
callback, | |||
extraArgs = [] |
|||
) | [inherited] |
def getComponentH | ( | self | ) |
def getComponentL | ( | self | ) |
def getComponentP | ( | self | ) |
def getComponentR | ( | self | ) |
def getComponentT | ( | self | ) |
def getComponentX | ( | self | ) |
def getComponentY | ( | self | ) |
def getComponentZ | ( | self | ) |
def getCurrentContexts | ( | self | ) | [inherited] |
def getDelayDeleteCount | ( | self | ) | [inherited] |
def getDelayDeleteEvent | ( | self | ) | [inherited] |
def getDisableEvent | ( | self | ) | [inherited] |
def getDoId | ( | self | ) | [inherited] |
Return the distributed object id
def getLocation | ( | self | ) | [inherited] |
def getNeverDisable | ( | self | ) | [inherited] |
def getParentObj | ( | self | ) | [inherited] |
def getPosHprBroadcastPeriod | ( | self | ) | [inherited] |
def getPosHprBroadcastTaskName | ( | self | ) | [inherited] |
posHprBroadcast ###
def getSmoothWrtReparents | ( | self | ) |
def hasCachedData | ( | self, | |
name | |||
) | [inherited] |
def isDisabled | ( | self | ) | [inherited] |
Returns true if the object has been disabled and/or deleted, or if it is brand new and hasn't yet been generated.
def isGenerated | ( | self | ) | [inherited] |
Returns true if the object has been fully generated by now, and not yet disabled.
def isGridParent | ( | self | ) | [inherited] |
def isLocal | ( | self | ) | [inherited] |
def peerToPeerResync | ( | self, | |
avId, | |||
timestamp, | |||
serverTime, | |||
uncertainty | |||
) |
def posHprBroadcastStarted | ( | self | ) | [inherited] |
def postGenerateMessage | ( | self | ) | [inherited] |
def reloadPosition | ( | self | ) |
This function re-reads the position from the node itself and clears any old position reports for the node. This should be used whenever show code bangs on the node position and expects it to stick.
def removeInterest | ( | self, | |
handle, | |||
event = None |
|||
) | [inherited] |
def returnResync | ( | self, | |
avId, | |||
timestampB, | |||
serverTimeSec, | |||
serverTimeUSec, | |||
uncertainty | |||
) |
A reply sent by a client whom we recently sent suggestResync to, this reports the client's new delta information so we can adjust our clock as well.
def sendCurrentPosition | ( | self | ) | [inherited] |
def sendDeleteMsg | ( | self | ) | [inherited] |
def sendDisableMsg | ( | self | ) | [inherited] |
def sendUpdate | ( | self, | |
fieldName, | |||
args = [] , |
|||
sendToId = None |
|||
) | [inherited] |
def setBarrierData | ( | self, | |
data | |||
) | [inherited] |
def setCacheable | ( | self, | |
bool | |||
) | [inherited] |
def setCachedData | ( | self, | |
name, | |||
data | |||
) | [inherited] |
def setComponentH | ( | self, | |
h | |||
) |
def setComponentL | ( | self, | |
l | |||
) |
def setComponentP | ( | self, | |
p | |||
) |
def setComponentR | ( | self, | |
r | |||
) |
def setComponentT | ( | self, | |
timestamp | |||
) |
def setComponentTLive | ( | self, | |
timestamp | |||
) |
def setComponentX | ( | self, | |
x | |||
) |
component set pos and hpr functions ###
These are the component functions that are invoked remotely by the above composite functions.
def setComponentY | ( | self, | |
y | |||
) |
def setComponentZ | ( | self, | |
z | |||
) |
def setLocation | ( | self, | |
parentId, | |||
zoneId, | |||
teleport = 0 |
|||
) | [inherited] |
def setLocation | ( | self, | |
parentId, | |||
zoneId | |||
) | [inherited] |
def setNeverDisable | ( | self, | |
bool | |||
) | [inherited] |
def setParent | ( | self, | |
parentToken | |||
) | [inherited] |
def setParentStr | ( | self, | |
parentTokenStr | |||
) | [inherited] |
def setPosHprBroadcastPeriod | ( | self, | |
period | |||
) | [inherited] |
def setSmH | ( | self, | |
h, | |||
timestamp = None |
|||
) |
def setSmHpr | ( | self, | |
h, | |||
p, | |||
r, | |||
timestamp = None |
|||
) |
def setSmoothWrtReparents | ( | self, | |
flag | |||
) |
def setSmPos | ( | self, | |
x, | |||
y, | |||
z, | |||
timestamp = None |
|||
) |
def setSmPosHpr | ( | self, | |
x, | |||
y, | |||
z, | |||
h, | |||
p, | |||
r, | |||
timestamp = None |
|||
) |
def setSmPosHprL | ( | self, | |
l, | |||
x, | |||
y, | |||
z, | |||
h, | |||
p, | |||
r, | |||
timestamp = None |
|||
) |
def setSmStop | ( | self, | |
timestamp = None |
|||
) |
def setSmXY | ( | self, | |
x, | |||
y, | |||
timestamp = None |
|||
) |
def setSmXYH | ( | self, | |
x, | |||
y, | |||
h, | |||
timestamp | |||
) |
def setSmXYZH | ( | self, | |
x, | |||
y, | |||
z, | |||
h, | |||
timestamp = None |
|||
) |
def setSmXZ | ( | self, | |
x, | |||
z, | |||
timestamp = None |
|||
) |
def setSmZ | ( | self, | |
z, | |||
timestamp = None |
|||
) |
def setXY | ( | self, | |
x, | |||
y | |||
) | [inherited] |
def setXYH | ( | self, | |
x, | |||
y, | |||
h | |||
) | [inherited] |
def setXYZH | ( | self, | |
x, | |||
y, | |||
z, | |||
h | |||
) | [inherited] |
def setXZ | ( | self, | |
x, | |||
z | |||
) | [inherited] |
def smoothPosition | ( | self | ) |
Methods to handle computing and updating of the smoothed position.
This function updates the position of the node to its computed smoothed position. This may be overridden by a derived class to specialize the behavior.
def startPosHprBroadcast | ( | self, | |
period = .2 , |
|||
stagger = 0 , |
|||
type = None |
|||
) | [inherited] |
def startSmooth | ( | self | ) |
This function starts the task that ensures the node is positioned correctly every frame. However, while the task is running, you won't be able to lerp the node or directly position it.
def status | ( | self, | |
indent = 0 |
|||
) | [inherited] |
print out "doId(parentId, zoneId) className and conditionally show generated, disabled, neverDisable, or cachable"
def stopPosHprBroadcast | ( | self | ) | [inherited] |
def stopSmooth | ( | self | ) |
This function stops the task spawned by startSmooth(), and allows show code to move the node around directly.
def suggestResync | ( | self, | |
avId, | |||
timestampA, | |||
timestampB, | |||
serverTimeSec, | |||
serverTimeUSec, | |||
uncertainty | |||
) |
This message is sent from one client to another when the other client receives a timestamp from this client that is so far out of date as to suggest that one or both clients needs to resynchronize their clock information.
def taskName | ( | self, | |
taskString | |||
) | [inherited] |
def uniqueName | ( | self, | |
idString | |||
) | [inherited] |
def updateAllRequiredFields | ( | self, | |
dclass, | |||
di | |||
) | [inherited] |
def updateRequiredFields | ( | self, | |
dclass, | |||
di | |||
) | [inherited] |
def updateRequiredOtherFields | ( | self, | |
dclass, | |||
di | |||
) | [inherited] |
def wantSmoothPosBroadcastTask | ( | self | ) | [inherited] |
def wantsSmoothing | ( | self | ) |
def wrtReparentTo | ( | self, | |
parent | |||
) |
activeState [inherited] |
broadcastType [inherited] |
tuple BroadcastTypes = Enum('FULL, XYH, XY') [static, inherited] |
cacheable [inherited] |
cnode [inherited] |
cr [inherited] |
d_broadcastPosHpr [inherited] |
dclass [inherited] |
destroyDoStackTrace [inherited] |
DistributedNode_deleted [inherited] |
DistributedNode_initialized [inherited] |
DistributedObject_deleted [inherited] |
DistributedObject_initialized [inherited] |
gotStringParentToken [inherited] |
gridParent [inherited] |
int neverDisable = 0 [static, inherited] |
neverDisable [inherited] |
tuple notify = directNotify.newCategory("DistributedObject") [static, inherited] |
Reimplemented in TimeManager.
parentId [inherited] |
zoneId [inherited] |