mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
*** empty log message ***
This commit is contained in:
parent
c60f0298c9
commit
20655d0303
@ -3,10 +3,15 @@
|
|||||||
|
|
||||||
class CartesianGridBase:
|
class CartesianGridBase:
|
||||||
def isValidZone(self, zoneId):
|
def isValidZone(self, zoneId):
|
||||||
if ((zoneId < self.startingZone) or
|
if self.style == "Cartesian":
|
||||||
(zoneId > self.startingZone + self.gridSize * self.gridSize - 1)):
|
if ((zoneId < self.startingZone) or
|
||||||
|
(zoneId > self.startingZone + self.gridSize * self.gridSize - 1)):
|
||||||
|
return 0
|
||||||
|
return 1
|
||||||
|
elif self.style == "CartesianStated":
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
return 0
|
return 0
|
||||||
return 1
|
|
||||||
|
|
||||||
def getZoneFromXYZ(self, pos):
|
def getZoneFromXYZ(self, pos):
|
||||||
# NOTE: pos should be relative to our own grid origin
|
# NOTE: pos should be relative to our own grid origin
|
||||||
|
@ -936,3 +936,22 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
|
|||||||
|
|
||||||
def haveCreateAuthority(self):
|
def haveCreateAuthority(self):
|
||||||
return (self.DOIDlast > self.DOIDnext)
|
return (self.DOIDlast > self.DOIDnext)
|
||||||
|
|
||||||
|
def getDoHierarchy(self):
|
||||||
|
return self.__doHierarchy
|
||||||
|
|
||||||
|
def getWorld(self, doId):
|
||||||
|
# Get the world node for this object
|
||||||
|
obj = self.doId2do[doId]
|
||||||
|
|
||||||
|
worldNP = obj.getParent()
|
||||||
|
while 1:
|
||||||
|
nextNP = worldNP.getParent()
|
||||||
|
if nextNP == render:
|
||||||
|
break
|
||||||
|
elif worldNP.isEmpty():
|
||||||
|
return None
|
||||||
|
return worldNP
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,9 +12,9 @@ class DistributedCartesianGridAI(DistributedNodeAI.DistributedNodeAI,
|
|||||||
|
|
||||||
RuleSeparator = ":"
|
RuleSeparator = ":"
|
||||||
|
|
||||||
def __init__(self, air, startingZone, gridSize, gridRadius):
|
def __init__(self, air, startingZone, gridSize, gridRadius, style="Cartesian"):
|
||||||
DistributedNodeAI.DistributedNodeAI.__init__(self, air)
|
DistributedNodeAI.DistributedNodeAI.__init__(self, air)
|
||||||
self.style = "Cartesian"
|
self.style = style
|
||||||
self.startingZone = startingZone
|
self.startingZone = startingZone
|
||||||
self.gridSize = gridSize
|
self.gridSize = gridSize
|
||||||
self.gridRadius = gridRadius
|
self.gridRadius = gridRadius
|
||||||
|
@ -370,4 +370,3 @@ class DistributedObject(PandaObject):
|
|||||||
def isGridParent(self):
|
def isGridParent(self):
|
||||||
# If this distributed object is a DistributedGrid return 1. 0 by default
|
# If this distributed object is a DistributedGrid return 1. 0 by default
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user