Panda3D
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
DistributedCartesianGridAI Class Reference
Inheritance diagram for DistributedCartesianGridAI:
DistributedNodeAI CartesianGridBase DistributedObjectAI DistributedObjectBase DirectObject

Public Member Functions

def __init__ (self, air, startingZone, gridSize, gridRadius, cellWidth, style="Cartesian")
 
def addObjectToGrid (self, av, useZoneId=-1, startAutoUpdate=True)
 
def delete (self)
 
def getCellWidth (self)
 
def getParentingRules (self)
 
def handleAvatarZoneChange (self, av, useZoneId=-1)
 
def handleSetLocation (self, av, parentId, zoneId)
 
def isGridParent (self)
 
def removeObjectFromGrid (self, av)
 
def startUpdateGridTask (self)
 updateGridTask This task is similar to the processVisibility task for the local client. More...
 
def stopUpdateGridTask (self)
 
def updateGridTask (self, task=None)
 
- Public Member Functions inherited from DistributedNodeAI
def __init__ (self, air, name=None)
 
def b_setParent (self, parentToken)
 setParent ### More...
 
def b_setPosHpr (self, x, y, z, h, p, r)
 
def b_setXYZH (self, x, y, z, h)
 
def d_setH (self, h)
 
def d_setHpr (self, h, p, r)
 
def d_setP (self, p)
 
def d_setParent (self, parentToken)
 
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_setY (self, y)
 
def d_setZ (self, z)
 
def delete (self)
 
def do_setParent (self, parentToken)
 
def getXYZH (self)
 
def setLocation (self, parentId, zoneId, teleport=0)
 
def setParent (self, parentToken)
 
def setParentStr (self, parentToken)
 
def setXY (self, x, y)
 
def setXYH (self, x, y, h)
 
def setXYZH (self, x, y, z, h)
 
- Public Member Functions inherited from DistributedObjectAI
def __init__ (self, air)
 
def addInterest (self, zoneId, note="", event=None)
 
def announceGenerate (self)
 
def b_setLocation (self, parentId, zoneId)
 
def beginBarrier (self, name, avIds, timeout, callback)
 
def d_setLocation (self, parentId, zoneId)
 
def delete (self)
 
def deleteOrDelay (self)
 
def execCommand (self, string, mwMgrId, avId, zoneId)
 
def generate (self)
 
def generateInit (self, repository=None)
 
def generateOtpObject (self, parentId, zoneId, optionalFields=[], doId=None)
 
def generateTargetChannel (self, repository)
 
def generateWithRequired (self, zoneId, optionalFields=[])
 
def generateWithRequiredAndId (self, doId, parentId, zoneId, optionalFields=[])
 
def GetAccountConnectionChannel (self, doId)
 
def GetAccountIDFromChannelCode (self, channel)
 
def GetAvatarIDFromChannelCode (self, channel)
 
def getBarrierData (self)
 
def getCacheable (self)
 
def getCollTrav (self, args, kArgs)
 
def getDelayDeleteCount (self)
 
def getDeleteEvent (self)
 
def getDoId (self)
 
def getLocation (self)
 
def getLogicalZoneChangeEvent (self)
 
def getNonCollidableParent (self)
 
def getParentMgr (self)
 
def GetPuppetConnectionChannel (self, doId)
 
def getRender (self)
 
def getZoneChangeEvent (self)
 
def getZoneData (self)
 
def handleLogicalZoneChange (self, newZoneId, oldZoneId)
 
def ignoreBarrier (self, context)
 
def initFromServerResponse (self, valDict)
 
def isDeleted (self)
 
def isGenerated (self)
 
def isGridParent (self)
 
def postGenerateMessage (self)
 
def preAllocateDoId (self)
 
def releaseZoneData (self)
 
def requestDelete (self)
 
def sendDeleteEvent (self)
 
def sendGenerateWithRequired (self, repository, parentId, zoneId, optionalFields=[])
 
def sendMessageBundle (self)
 
def sendSetZone (self, zoneId)
 
def sendUpdate (self, fieldName, args=[])
 
def sendUpdateToAccountId (self, accountId, fieldName, args)
 
def sendUpdateToAvatarId (self, avId, fieldName, args)
 
def sendUpdateToChannel (self, channelId, fieldName, args)
 
def setBarrierReady (self, context)
 
def setLocation (self, parentId, zoneId)
 
def startMessageBundle (self, name)
 
def status (self, indent=0)
 
def taskName (self, taskString)
 
def uniqueName (self, idString)
 
def updateAllRequiredFields (self, dclass, di)
 
def updateAllRequiredOtherFields (self, dclass, di)
 
def updateRequiredFields (self, dclass, di)
 
def updateRequiredOtherFields (self, dclass, di)
 
def validate (self, avId, bool, msg)
 
- Public Member Functions inherited from DistributedObjectBase
def __init__ (self, cr)
 
def getLocation (self)
 
def getParentObj (self)
 
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)
 
def status (self, indent=0)
 
- 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 CartesianGridBase
def getConcentricZones (self, zoneId, radius)
 
def getGridSizeFromSphere (self, sphereRadius, spherePos, cellWidth, gridRadius)
 
def getGridSizeFromSphereRadius (self, sphereRadius, cellWidth, gridRadius)
 
def getZoneCellOrigin (self, zoneId)
 
def getZoneCellOriginCenter (self, zoneId)
 
def getZoneFromXYZ (self, pos, wantRowAndCol=False)
 
def isValidZone (self, zoneId)
 

Public Attributes

 cellWidth
 
 gridObjects
 
 gridRadius
 
 gridSize
 
 startingZone
 
 style
 
 updateTaskStarted
 
- Public Attributes inherited from DistributedNodeAI
 DistributedNodeAI_initialized
 
 gridParent
 
- Public Attributes inherited from DistributedObjectAI
 accountName
 
 air
 Asad: As per Roger's suggestion, turn off the following block until a solution is thought out of how to prevent this delete message or to handle this message better TODO: do we still need this check? More...
 
 dclass
 
 DistributedObjectAI_initialized
 
 doId
 
 lastNonQuietZone
 
 parentId
 
 zoneId
 
- Public Attributes inherited from DistributedObjectBase
 children
 
 cr
 
 parentId
 
 zoneId
 
- Public Attributes inherited from CartesianGridBase
 style
 

Static Public Attributes

 notify = directNotify.newCategory("DistributedCartesianGridAI")
 
string RuleSeparator = ":"
 
- Static Public Attributes inherited from DistributedObjectAI
 notify = directNotify.newCategory("DistributedObjectAI")
 
int QuietZone = 1
 
- Static Public Attributes inherited from DistributedObjectBase
 notify = directNotify.newCategory("DistributedObjectBase")
 

Additional Inherited Members

- Static Public Member Functions inherited from DistributedObjectAI
def staticGetLogicalZoneChangeEvent (doId)
 
def staticGetZoneChangeEvent (doId)
 

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  air,
  startingZone,
  gridSize,
  gridRadius,
  cellWidth,
  style = "Cartesian" 
)

Member Function Documentation

◆ addObjectToGrid()

def addObjectToGrid (   self,
  av,
  useZoneId = -1,
  startAutoUpdate = True 
)

◆ delete()

def delete (   self)

◆ getCellWidth()

def getCellWidth (   self)

◆ getParentingRules()

def getParentingRules (   self)

◆ handleAvatarZoneChange()

def handleAvatarZoneChange (   self,
  av,
  useZoneId = -1 
)

◆ handleSetLocation()

def handleSetLocation (   self,
  av,
  parentId,
  zoneId 
)

◆ isGridParent()

def isGridParent (   self)

◆ removeObjectFromGrid()

def removeObjectFromGrid (   self,
  av 
)

◆ startUpdateGridTask()

def startUpdateGridTask (   self)

updateGridTask This task is similar to the processVisibility task for the local client.

A couple differences:

  • we are not doing setInterest on the AI (that is a local client specific call).
  • we assume that the moving objects on the grid are parented to a gridParent, and are broadcasting their position relative to that gridParent. This makes the task's math easy. Just check to see when our position goes out of the current grid cell. When it does, call handleAvatarZoneChange

◆ stopUpdateGridTask()

def stopUpdateGridTask (   self)

◆ updateGridTask()

def updateGridTask (   self,
  task = None 
)

Member Data Documentation

◆ cellWidth

cellWidth

◆ gridObjects

gridObjects

◆ gridRadius

gridRadius

◆ gridSize

gridSize

◆ notify

notify = directNotify.newCategory("DistributedCartesianGridAI")
static

◆ RuleSeparator

string RuleSeparator = ":"
static

◆ startingZone

startingZone

◆ style

style

◆ updateTaskStarted

updateTaskStarted