Package pymunk :: Class BB
[frames] | no frames]

Class BB

object --+
         |
        BB

Simple bounding box class. Stored as left, bottom, right, top values.
Instance Methods
 
__init__(self, *args)
Create a new instance of a bounding box.
 
__repr__(self)
repr(x)
 
__eq__(self, other)
 
__ne__(self, other)
 
intersects(self, other)
Returns true if the bounding boxes intersect
 
contains(self, other)
Returns true if bb completley contains the other bb
 
contains_vect(self, v)
Returns true if this bb contains the vector v
 
merge(self, other)
Return the minimal bounding box that contains both this bb and the other bb
 
expand(self, v)
Return the minimal bounding box that contans both this bounding box and the vector v
 
clamp_vect(self, v)
Returns a copy of the vector v clamped to the bounding box
 
wrap_vect(self, v)
Returns a copy of v wrapped to the bounding box.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
  left
  bottom
  right
  top

Inherited from object: __class__

Method Details

__init__(self, *args)
(Constructor)

 
Create a new instance of a bounding box. Can be created with zero size with bb = BB() or with four args defining left, bottom, right and top: bb = BB(left, bottom, right, top)
Overrides: object.__init__

__repr__(self)
(Representation operator)

 
repr(x)
Overrides: object.__repr__
(inherited documentation)

wrap_vect(self, v)

 
Returns a copy of v wrapped to the bounding box. That is, BB(0,0,10,10).wrap_vect((5,5)) == Vec2d(10,10)

Property Details

left

Get Method:
unreachable(self)

bottom

Get Method:
unreachable(self)

right

Get Method:
unreachable(self)

top

Get Method:
unreachable(self)