def makeChunkIter(self): radius = self.viewDistance # If the focal point of the camera is less than twice the view distance away, load # chunks around that point. Otherwise, load chunks around the camera's position. vc = self.viewCenter() if max(abs(a) for a in (vc - self.centerPoint)) < radius * 2 * 16: x, y, z = vc else: x, y, z = self.centerPoint return iterateChunks(x, z, radius)
def makeChunkIter(self): bottomRight = self.unprojectAtHeight(self.width(), self.height(), self.dimension.bounds.maxy) topLeft = self.unprojectAtHeight(0, 0, self.dimension.bounds.miny) center = self.unprojectAtHeight(self.width()/2, self.height()/2, 0) # xxx # self.dimension.bounds.miny + self.dimension.bounds.height / 4 br = bottomRight.chunkPos() tl = topLeft.chunkPos() w = abs(br[0] - tl[0]) h = abs(br[1] - tl[1]) d = max(w, h) + 2 return iterateChunks(center[0], center[2], d / 2)
def makeChunkIter(self): bottomRight = self.unprojectAtHeight(self.width(), self.height(), self.dimension.bounds.maxy) topLeft = self.unprojectAtHeight(0, 0, self.dimension.bounds.miny) center = self.unprojectAtHeight(self.width() / 2, self.height() / 2, 0) # xxx # self.dimension.bounds.miny + self.dimension.bounds.height / 4 br = bottomRight.chunkPos() tl = topLeft.chunkPos() w = abs(br[0] - tl[0]) h = abs(br[1] - tl[1]) d = max(w, h) + 2 return iterateChunks(center[0], center[2], d / 2)