Example #1
0
 def Body(self, idx: int):
     DeviceAllocator.rand_init(kSeed, idx, 0)
     self.pos = Vector(2.0 * DeviceAllocator.rand_uniform() - 1.0,
                       2.0 * DeviceAllocator.rand_uniform() - 1.0)
     self.vel = Vector(0.0, 0.0)
     self.force = Vector(0.0, 0.0)
     self.mass = (DeviceAllocator.rand_uniform() / 2.0 + 0.5) * kMaxMass
Example #2
0
 def Body(self, idx: int):
     DeviceAllocator.rand_init(kSeed, idx, 0)
     self.pos_x = 2.0 * DeviceAllocator.rand_uniform() - 1.0
     self.pos_y = 2.0 * DeviceAllocator.rand_uniform() - 1.0
     self.vel_x = 0.0
     self.vel_y = 0.0
     self.mass = (DeviceAllocator.rand_uniform() / 2.0 + 0.5) * kMaxMass
     self.force_x = 0.0
     self.force_y = 0.0