コード例 #1
0
ファイル: b2_world.py プロジェクト: jcpassy/roboball2d
 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
コード例 #2
0
ファイル: robot2d.py プロジェクト: gehring/rossim
    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)
コード例 #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)
コード例 #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)
コード例 #5
0
 def __init__(self, textSystem, car):
     b2ContactListener.__init__(self)
     self.textSystem = textSystem
     self.playerCar = car
コード例 #6
0
 def __init__(self):
     b2ContactListener.__init__(self)
コード例 #7
0
 def __init__(self, world):
     b2ContactListener.__init__(self)
     self.world = world
コード例 #8
0
ファイル: robotsim.py プロジェクト: bblais/RobotSim373
 def __init__(self, env):
     b2ContactListener.__init__(self)
     self.env = env
コード例 #9
0
ファイル: collisions.py プロジェクト: ratalaika/archers
 def __init__(self, world):
     b2ContactListener.__init__(self)
     self.world = world
コード例 #10
0
ファイル: game.py プロジェクト: NickShadder/libavg-multipong
 def __init__(self, hitset):
     b2ContactListener.__init__(self)
     self.hitset = hitset
コード例 #11
0
 def __init__(self, callback_parent):
     b2ContactListener.__init__(self)
     self.callback_parent = callback_parent
コード例 #12
0
ファイル: contact.py プロジェクト: dferrer/Pool
 def __init__(self):
     b2ContactListener.__init__(self)
     self.to_destroy = []
コード例 #13
0
 def __init__(self, textSystem, car):
     b2ContactListener.__init__(self)
     self.textSystem = textSystem
     self.playerCar = car
コード例 #14
0
 def __init__(self):
     self.beginContact = b2Contact
     self.hasContact = False
     b2ContactListener.__init__(self)