Переглянути джерело

*** empty log message ***

Samir Naik 20 роки тому
батько
коміт
20655d0303

+ 8 - 3
direct/src/distributed/CartesianGridBase.py

@@ -3,10 +3,15 @@
 
 class CartesianGridBase:
     def isValidZone(self, zoneId):
-        if ((zoneId < self.startingZone) or
-            (zoneId > self.startingZone + self.gridSize * self.gridSize - 1)):
+        if self.style == "Cartesian":
+            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 1
     
     def getZoneFromXYZ(self, pos):
         # NOTE: pos should be relative to our own grid origin

+ 19 - 0
direct/src/distributed/ClientRepository.py

@@ -936,3 +936,22 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
 
     def haveCreateAuthority(self):
         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
+            
+        
+    

+ 2 - 2
direct/src/distributed/DistributedCartesianGridAI.py

@@ -12,9 +12,9 @@ class DistributedCartesianGridAI(DistributedNodeAI.DistributedNodeAI,
 
     RuleSeparator = ":"
 
-    def __init__(self, air, startingZone, gridSize, gridRadius):
+    def __init__(self, air, startingZone, gridSize, gridRadius, style="Cartesian"):
         DistributedNodeAI.DistributedNodeAI.__init__(self, air)
-        self.style = "Cartesian"
+        self.style = style
         self.startingZone = startingZone
         self.gridSize = gridSize
         self.gridRadius = gridRadius

+ 0 - 1
direct/src/distributed/DistributedObject.py

@@ -370,4 +370,3 @@ class DistributedObject(PandaObject):
     def isGridParent(self):
         # If this distributed object is a DistributedGrid return 1.  0 by default
         return 0
-