def __init__(self, xmin=None, xmax=None, ymin=None, ymax=None, pos=None, vel=(0, 0), shape=None, rect=None, **kwds): xmin, xmax, ymin, ymax = shapes.aabb_coords( xmin, xmax, ymin, ymax, rect=rect, shape=shape, pos=pos ) pos = (xmin + xmax) / 2., (ymin + ymax) / 2. self._delta_x = dx = (xmax - xmin) / 2 self._delta_y = dy = (ymax - ymin) / 2 aabb = shapes.AABB(-dx, dx, -dy, dy) super(AABB, self).__init__(pos, vel, base_shape=aabb, cbb_radius=sqrt(dx ** 2 + dy ** 2), **kwds)
def __init__(self, xmin=None, xmax=None, ymin=None, ymax=None, pos=None, vel=(0, 0), mass=None, density=None, bbox=None, shape=None, rect=None, **kwds): # Define as propriedades das caixas de contorno xmin, xmax, ymin, ymax = shapes.aabb_bbox(bbox=bbox, rect=rect, shape=shape, pos=pos, xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax) pos = ((xmin + xmax) / 2., (ymin + ymax) / 2.) self._delta_x = dx = (xmax - xmin) / 2 self._delta_y = dy = (ymax - ymin) / 2 self.cbb_radius = sqrt(dx ** 2 + dy ** 2) aabb = shapes.AABB(-dx, dx, -dy, dy) super(AABB, self).__init__(pos, vel, mass=mass, density=density, baseshape=aabb, **kwds)
def ROG(self): '''Raio de giração. Subclasses devem sobrescrever ROG_sqr, ao invés deste método.''' return sqrt(self.ROG_sqr())