def append(self, spawnpoint): # update centroid f = len(self._spawnpoints) / (len(self._spawnpoints) + 1.0) self.centroid = utils.intermediate_point(spawnpoint.position, self.centroid, f) self._spawnpoints.append(spawnpoint) if spawnpoint.time < self.min_time: self.min_time = spawnpoint.time if spawnpoint.time > self.max_time: self.max_time = spawnpoint.time
def simulate_centroid(self, spawnpoint): f = len(self._spawnpoints) / (len(self._spawnpoints) + 1.0) new_centroid = utils.intermediate_point(spawnpoint.position, self.centroid, f) return new_centroid