Panda3D
Public Member Functions | Public Attributes | List of all members
DistributedSmoothNode Class Reference
Inheritance diagram for DistributedSmoothNode:
DistributedNode DistributedSmoothNodeBase DistributedObject DistributedObjectBase DirectObject

Public Member Functions

def __init__ (self, cr)
 
def activateSmoothing (self, smoothing, prediction)
 
def clearSmoothing (self, bogus=None)
 
def d_returnResync (self, avId, timestampB, serverTime, uncertainty)
 
def d_setParent (self, parentToken)
 
def d_suggestResync (self, avId, timestampA, timestampB, serverTime, uncertainty)
 Monitor clock sync ###. More...
 
def delete (self)
 
def disable (self)
 
def doSmoothTask (self, task)
 
def forceToTruePosition (self)
 
def generate (self)
 
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 getSmoothWrtReparents (self)
 
def peerToPeerResync (self, avId, timestamp, serverTime, uncertainty)
 
def reloadPosition (self)
 
def returnResync (self, avId, timestampB, serverTimeSec, serverTimeUSec, uncertainty)
 
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 ### More...
 
def setComponentY (self, y)
 
def setComponentZ (self, z)
 
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 smoothPosition (self)
 Methods to handle computing and updating of the smoothed position. More...
 
def startSmooth (self)
 
def stopSmooth (self)
 
def suggestResync (self, avId, timestampA, timestampB, serverTimeSec, serverTimeUSec, uncertainty)
 
def wantsSmoothing (self)
 
def wrtReparentTo (self, parent)
 
- Public Member Functions inherited from DistributedNode
def __cmp__ (self, other)
 
def b_setParent (self, parentToken)
 setParent ### More...
 
def d_setH (self, h)
 
def d_setHpr (self, h, p, r)
 
def d_setP (self, p)
 
def d_setPos (self, x, y, z)
 
def d_setPosHpr (self, x, y, z, h, p, r)
 
def d_setR (self, r)
 
def d_setX (self, x)
 set pos and hpr functions ####### More...
 
def d_setXY (self, x, y)
 
def d_setXYH (self, x, y, h)
 
def d_setXYZH (self, x, y, z, h)
 
def d_setXZ (self, x, z)
 
def d_setY (self, y)
 
def d_setZ (self, z)
 
def do_setParent (self, parentToken)
 
def setLocation (self, parentId, zoneId, teleport=0)
 
def setParent (self, parentToken)
 
def setParentStr (self, parentTokenStr)
 
def setXY (self, x, y)
 
def setXYH (self, x, y, h)
 
def setXYZH (self, x, y, z, h)
 
def setXZ (self, x, z)
 
- Public Member Functions inherited from DistributedObject
def addInterest (self, zoneId, note="", event=None)
 
def announceGenerate (self)
 
def b_setLocation (self, parentId, zoneId)
 
def d_setLocation (self, parentId, zoneId)
 
def deleteOrDelay (self)
 
def disableAndAnnounce (self)
 
def disableAnnounceAndDelete (self)
 
def doCallbackContext (self, context, args)
 
def doneBarrier (self, name=None)
 
def execCommand (self, string, mwMgrId, avId, zoneId)
 
def flushCachedData (self, name)
 
def generateInit (self)
 
def getAutoInterests (self)
 
def getBarrierData (self)
 
def getCacheable (self)
 
def getCachedData (self, name)
 
def getCallback (self, context)
 
def getCallbackArgs (self, context)
 
def getCallbackContext (self, callback, extraArgs=[])
 
def getCurrentContexts (self)
 
def getDelayDeleteCount (self)
 
def getDelayDeleteEvent (self)
 
def getDisableEvent (self)
 
def getDoId (self)
 
def getLocation (self)
 
def getNeverDisable (self)
 
def getParentObj (self)
 
def hasCachedData (self, name)
 
def isDisabled (self)
 
def isGenerated (self)
 
def isGridParent (self)
 
def isLocal (self)
 
def postGenerateMessage (self)
 
def removeInterest (self, handle, event=None)
 
def sendDeleteMsg (self)
 
def sendDisableMsg (self)
 
def sendUpdate (self, fieldName, args=[], sendToId=None)
 
def setBarrierData (self, data)
 
def setCacheable (self, bool)
 
def setCachedData (self, name, data)
 
def setLocation (self, parentId, zoneId)
 
def setNeverDisable (self, bool)
 
def status (self, indent=0)
 
def taskName (self, taskString)
 
def uniqueName (self, idString)
 
def updateAllRequiredFields (self, dclass, di)
 
def updateRequiredFields (self, dclass, di)
 
def updateRequiredOtherFields (self, dclass, di)
 
- Public Member Functions inherited from DistributedObjectBase
def handleChildArrive (self, childObj, zoneId)
 
def handleChildArriveZone (self, childObj, zoneId)
 
def handleChildLeave (self, childObj, zoneId)
 
def handleChildLeaveZone (self, childObj, zoneId)
 
def handleQueryObjectChildrenLocalDone (self, context)
 
def hasParentingRules (self)
 
- Public Member Functions inherited from DirectObject
def __init__ (self)
 
def accept (self, event, method, extraArgs=[])
 
def acceptOnce (self, event, method, extraArgs=[])
 
def addTask (self, *args, **kwargs)
 
def detectLeaks (self)
 
def doMethodLater (self, *args, **kwargs)
 
def getAllAccepting (self)
 
def ignore (self, event)
 
def ignoreAll (self)
 
def isAccepting (self, event)
 
def isIgnoring (self, event)
 
def removeAllTasks (self)
 
def removeTask (self, taskOrName)
 
- Public Member Functions inherited from DistributedSmoothNodeBase
def __init__ (self)
 
def b_clearSmoothing (self)
 
def d_clearSmoothing (self)
 
def getPosHprBroadcastPeriod (self)
 
def getPosHprBroadcastTaskName (self)
 posHprBroadcast ### More...
 
def posHprBroadcastStarted (self)
 
def sendCurrentPosition (self)
 
def setPosHprBroadcastPeriod (self, period)
 
def startPosHprBroadcast (self, period=.2, stagger=0, type=None)
 
def stopPosHprBroadcast (self)
 
def wantSmoothPosBroadcastTask (self)
 

Public Attributes

 DistributedSmoothNode_initialized
 
 lastSuggestResync
 
 localControl
 
 smoother
 
 smoothStarted
 
 stopped
 
- Public Attributes inherited from DistributedNode
 DistributedNode_deleted
 
 DistributedNode_initialized
 
 gotStringParentToken
 
 gridParent
 
- Public Attributes inherited from DistributedObject
 activeState
 
 autoInterests
 
 cacheable
 
 cr
 
 dclass
 
 destroyDoStackTrace
 
 DistributedObject_deleted
 
 DistributedObject_initialized
 
 neverDisable
 
 parentId
 
 zoneId
 
- Public Attributes inherited from DistributedObjectBase
 cr
 
 parentId
 
 zoneId
 
- Public Attributes inherited from DistributedSmoothNodeBase
 broadcastType
 
 cnode
 
 d_broadcastPosHpr
 

Additional Inherited Members

- Static Public Attributes inherited from DistributedObject
int neverDisable = 0
 
 notify = directNotify.newCategory("DistributedObject")
 
- Static Public Attributes inherited from DistributedObjectBase
 notify = directNotify.newCategory("DistributedObjectBase")
 
- Static Public Attributes inherited from DirectObject
def accept_once = acceptOnce
 
def add_task = addTask
 
def detect_leaks = detectLeaks
 
def do_method_later = doMethodLater
 
def get_all_accepting = getAllAccepting
 
def ignore_all = ignoreAll
 
def is_accepting = isAccepting
 
def is_ignoring = isIgnoring
 
def remove_all_tasks = removeAllTasks
 
def remove_task = removeTask
 
- Static Public Attributes inherited from DistributedSmoothNodeBase
 BroadcastTypes = Enum('FULL, XYH, XY')
 

Detailed Description

This specializes DistributedNode to add functionality to smooth
motion over time, via the SmoothMover C++ object defined in
DIRECT.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  cr 
)

Reimplemented from DistributedNode.

Member Function Documentation

◆ activateSmoothing()

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

◆ clearSmoothing()

def clearSmoothing (   self,
  bogus = None 
)

◆ d_returnResync()

def d_returnResync (   self,
  avId,
  timestampB,
  serverTime,
  uncertainty 
)

◆ d_setParent()

def d_setParent (   self,
  parentToken 
)

Reimplemented from DistributedNode.

◆ d_suggestResync()

def d_suggestResync (   self,
  avId,
  timestampA,
  timestampB,
  serverTime,
  uncertainty 
)

Monitor clock sync ###.

◆ delete()

def delete (   self)
Inheritors should redefine this to take appropriate action on delete

Reimplemented from DistributedNode.

◆ disable()

def disable (   self)
Inheritors should redefine this to take appropriate action on disable

Reimplemented from DistributedNode.

◆ doSmoothTask()

def doSmoothTask (   self,
  task 
)

◆ forceToTruePosition()

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.

◆ generate()

def generate (   self)
Inheritors should redefine this to take appropriate action on generate

Reimplemented from DistributedNode.

◆ getComponentH()

def getComponentH (   self)

◆ getComponentL()

def getComponentL (   self)

◆ getComponentP()

def getComponentP (   self)

◆ getComponentR()

def getComponentR (   self)

◆ getComponentT()

def getComponentT (   self)

◆ getComponentX()

def getComponentX (   self)

◆ getComponentY()

def getComponentY (   self)

◆ getComponentZ()

def getComponentZ (   self)

◆ getSmoothWrtReparents()

def getSmoothWrtReparents (   self)

◆ peerToPeerResync()

def peerToPeerResync (   self,
  avId,
  timestamp,
  serverTime,
  uncertainty 
)

◆ reloadPosition()

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.

◆ returnResync()

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.

◆ setComponentH()

def setComponentH (   self,
  h 
)

◆ setComponentL()

def setComponentL (   self,
  l 
)

◆ setComponentP()

def setComponentP (   self,
  p 
)

◆ setComponentR()

def setComponentR (   self,
  r 
)

◆ setComponentT()

def setComponentT (   self,
  timestamp 
)

◆ setComponentTLive()

def setComponentTLive (   self,
  timestamp 
)

◆ setComponentX()

def setComponentX (   self,
  x 
)

component set pos and hpr functions ###

These are the component functions that are invoked remotely by the above composite functions.

◆ setComponentY()

def setComponentY (   self,
  y 
)

◆ setComponentZ()

def setComponentZ (   self,
  z 
)

◆ setSmH()

def setSmH (   self,
  h,
  timestamp = None 
)

◆ setSmHpr()

def setSmHpr (   self,
  h,
  p,
  r,
  timestamp = None 
)

◆ setSmoothWrtReparents()

def setSmoothWrtReparents (   self,
  flag 
)

◆ setSmPos()

def setSmPos (   self,
  x,
  y,
  z,
  timestamp = None 
)

◆ setSmPosHpr()

def setSmPosHpr (   self,
  x,
  y,
  z,
  h,
  p,
  r,
  timestamp = None 
)

◆ setSmPosHprL()

def setSmPosHprL (   self,
  l,
  x,
  y,
  z,
  h,
  p,
  r,
  timestamp = None 
)

◆ setSmStop()

def setSmStop (   self,
  timestamp = None 
)

◆ setSmXY()

def setSmXY (   self,
  x,
  y,
  timestamp = None 
)

◆ setSmXYH()

def setSmXYH (   self,
  x,
  y,
  h,
  timestamp 
)

◆ setSmXYZH()

def setSmXYZH (   self,
  x,
  y,
  z,
  h,
  timestamp = None 
)

◆ setSmXZ()

def setSmXZ (   self,
  x,
  z,
  timestamp = None 
)

◆ setSmZ()

def setSmZ (   self,
  z,
  timestamp = None 
)

◆ smoothPosition()

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.

◆ startSmooth()

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.

◆ stopSmooth()

def stopSmooth (   self)
This function stops the task spawned by startSmooth(), and
allows show code to move the node around directly.

◆ suggestResync()

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.

◆ wantsSmoothing()

def wantsSmoothing (   self)

◆ wrtReparentTo()

def wrtReparentTo (   self,
  parent 
)

Member Data Documentation

◆ DistributedSmoothNode_initialized

DistributedSmoothNode_initialized

◆ lastSuggestResync

lastSuggestResync

◆ localControl

localControl

◆ smoother

smoother

◆ smoothStarted

smoothStarted

◆ stopped

stopped