Esempio n. 1
0
	def setOffset(self, offset):
		self.offset = offset
		self.partition.stop()
		self.partition = Partition(
			offset,
			self.container.points,
			self.obstacles
			)
Esempio n. 2
0
	def __init__(self, offset, xml_filename):
		self.areas = {}
		self.vertices = {}
		self.width = 0
		self.height = 0
		self.obstacles = []
		self.dynamic_obstacles = []
		self.offset = offset
		
		self.load_xml(xml_filename)
		self.container = Poly(((0,0),(self.width,0),(self.width,self.height),(0,self.height)))
		self.partition = Partition(
			offset,
			self.container.points,
			self.obstacles
			)
		self.calc_areas()
		self.calc_vertex_graph()
		self.pathfinding_area = AStar(self.areas.values(), NAVGRAPH)
		self.pathfinding_vertices = AStar(self.vertices.values(), NAVGRAPH)