Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Static Public Attributes

# DistributedCartesianGridAI Class Reference

Inherits DistributedNodeAI::DistributedNodeAI, and CartesianGridBase::CartesianGridBase.

List of all members.

## Public Member Functions
def | __init__
def | addObjectToGrid
def | delete
def | getCellWidth
def | getParentingRules
def | handleAvatarZoneChange
def | handleSetLocation
def | isGridParent
def | removeObjectFromGrid
def | startUpdateGridTask
| updateGridTask This task is similar to the processVisibility task for the local client.
def | stopUpdateGridTask
def | updateGridTask
## Public Attributes
| cellWidth
| gridObjects
| gridRadius
| gridSize
| startingZone
| style
| updateTaskStarted
## Static Public Attributes
tuple | notify = directNotify.newCategory("DistributedCartesianGridAI")
string | RuleSeparator = ":"

## Constructor & Destructor Documentation

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

## Member Function Documentation

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.

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

def stopUpdateGridTask | ( |  | self | ) |

def updateGridTask | ( |  | self,
|  |  | task = `None`
| ) |  |

## Member Data Documentation

cellWidth

gridObjects

gridRadius

gridSize

tuple notify = directNotify.newCategory("DistributedCartesianGridAI")`[static]`

string RuleSeparator = ":"`[static]`

startingZone

style

updateTaskStarted

All Classes Namespaces Functions Variables Enumerations Enumerator Properties