def __init__(self, state, position, momentum): Particle.__init__(self, state, position, momentum) self.values.set('ignoreDrag', True) self.values.set('ignoreGravity', True) self.values.add('attraction', 300) self.physicsName = 'attractors' self.name = 'attractor'
def __init__(self, state, position, momentum): Particle.__init__(self, state, position, momentum) self.values.set('ignoreGravity', True) self.values.set('ignoreDrag', True) self.values.set('unattractable', True) self.values.add('timeScale', 0.01) self.values.add('timeRadius', 200) self.timeRadius = 200 self.physicsName = 'timebubbles' self.name = 'timebubble'
def __init__(self, identity, pos=np.zeros(2), speed=np.zeros(2), acc=np.zeros(2), goal=None, color=None): "init boid with id, initial position, speed and acceleration" Particle.__init__(self, identity) self.type = TYPE_BOID self.pos = pos.astype('int32') self.speed = speed.astype('int32') self.acc = acc.astype('int32') self.goal_id = goal self.last_goal_id = None self.color = color or np.random.randint(255, size=3) self.timer = 0 self.collision_count = 0 self.bot = bot() self.bot.posx = self.pos[0] / self.v_max * 0.74 self.bot.posy = self.pos[1] / self.v_max * 0.74
def __init__(self, start_x, start_y, identifier=0): Particle.__init__(self, start_x, start_y, identifier=0)