Esempio n. 1
0
 def __init__(self, world, contacts, balls, robots):
     b2ContactListener.__init__(self)
     # instance of b2_world
     self.world = world
     self.contacts = contacts
     # booleans indicating if the related
     # contacts should be managed
     self.balls = balls
     self.robots = robots
Esempio n. 2
0
    def __init__(self, radius=0.5, nbumpers = 6, nlasers= 16):
        b2ContactListener.__init__(self)

        self.radius = radius
        self.inputs = self.getDefaultInput()
        self.applypoints = ((-radius, 0), (radius, 0))
        self.vertices = numpy.array([(0,0)]+[(math.sin(x)*radius, math.cos(x)*radius)
                        for x in numpy.linspace(0, math.pi*2, self.vertex_count)])
        self.nlasers = nlasers
        self.nbumpers = nbumpers
        self.laserrange = LaserRangeFinder()

        self.output = numpy.zeros(nlasers + nbumpers)
Esempio n. 3
0
    def __init__(self, radius=0.5, nbumpers=6, nlasers=16):
        b2ContactListener.__init__(self)

        self.radius = radius
        self.inputs = self.getDefaultInput()
        self.applypoints = ((-radius, 0), (radius, 0))
        self.vertices = numpy.array(
            [(0, 0)] +
            [(math.sin(x) * radius, math.cos(x) * radius)
             for x in numpy.linspace(0, math.pi * 2, self.vertex_count)])
        self.nlasers = nlasers
        self.nbumpers = nbumpers
        self.laserrange = LaserRangeFinder()

        self.output = numpy.zeros(nlasers + nbumpers)
Esempio n. 4
0
    def __init__(self, dynProps=defObjDyn, impactT=10, dt=1. / 120.):
        SCALE = ControlSystem.MODEL_SCALE

        self.dt = dt
        self.objDynProps = dynProps

        self.refL = b2Vec2(.8, .5) * SCALE
        self.refR = b2Vec2(1., .5) * SCALE
        self.objVel_ = b2Vec2(0., 0.)
        self.errorRprev = None
        self.errorLprev = None
        self.crushed = False
        self.impactT = impactT

        b2ContactListener.__init__(self)
Esempio n. 5
0
 def __init__(self, textSystem, car):
     b2ContactListener.__init__(self)
     self.textSystem = textSystem
     self.playerCar = car
 def __init__(self):
     b2ContactListener.__init__(self)
Esempio n. 7
0
 def __init__(self, world):
     b2ContactListener.__init__(self)
     self.world = world
Esempio n. 8
0
 def __init__(self, env):
     b2ContactListener.__init__(self)
     self.env = env
Esempio n. 9
0
 def __init__(self, world):
     b2ContactListener.__init__(self)
     self.world = world
Esempio n. 10
0
 def __init__(self, hitset):
     b2ContactListener.__init__(self)
     self.hitset = hitset
Esempio n. 11
0
 def __init__(self, callback_parent):
     b2ContactListener.__init__(self)
     self.callback_parent = callback_parent
Esempio n. 12
0
 def __init__(self):
     b2ContactListener.__init__(self)
     self.to_destroy = []
Esempio n. 13
0
 def __init__(self, textSystem, car):
     b2ContactListener.__init__(self)
     self.textSystem = textSystem
     self.playerCar = car
Esempio n. 14
0
 def __init__(self):
     self.beginContact = b2Contact
     self.hasContact = False
     b2ContactListener.__init__(self)