Panda3D
Public Member Functions | Public Attributes

DistributedSmoothNode Class Reference

Inheritance diagram for DistributedSmoothNode:
DistributedNode DistributedSmoothNodeBase DistributedObject

List of all members.

Public Member Functions

def __init__
def activateSmoothing
def clearSmoothing
def d_returnResync
def d_setParent
def d_suggestResync
 Monitor clock sync ###.
def delete
def disable
def doSmoothTask
def forceToTruePosition
def generate
def getComponentH
def getComponentL
def getComponentP
def getComponentR
def getComponentT
def getComponentX
def getComponentY
def getComponentZ
def getSmoothWrtReparents
def peerToPeerResync
def reloadPosition
def returnResync
def setComponentH
def setComponentL
def setComponentP
def setComponentR
def setComponentT
def setComponentTLive
def setComponentX
 component set pos and hpr functions ###
def setComponentY
def setComponentZ
def setSmH
def setSmHpr
def setSmoothWrtReparents
def setSmPos
def setSmPosHpr
def setSmPosHprL
def setSmStop
def setSmXY
def setSmXYH
def setSmXYZH
def setSmXZ
def setSmZ
def smoothPosition
 Methods to handle computing and updating of the smoothed position.
def startSmooth
def stopSmooth
def suggestResync
def wantsSmoothing
def wrtReparentTo

Public Attributes

 DistributedSmoothNode_initialized
 lastSuggestResync
 localControl
 smoother
 smoothStarted
 stopped

Detailed Description

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

Constructor & Destructor Documentation

def __init__ (   self,
  cr 
)

Reimplemented from DistributedNode.


Member Function Documentation

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 clearSmoothing (   self,
  bogus = None 
)
def d_returnResync (   self,
  avId,
  timestampB,
  serverTime,
  uncertainty 
)
def d_setParent (   self,
  parentToken 
)

Reimplemented from DistributedNode.

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 disable (   self)
Inheritors should redefine this to take appropriate action on disable

Reimplemented from DistributedNode.

def doSmoothTask (   self,
  task 
)
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 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)
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 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 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 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.

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 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 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 wantsSmoothing (   self)
def wrtReparentTo (   self,
  parent 
)

Member Data Documentation

 All Classes Namespaces Functions Variables Properties