Chipmunk's axis-aligned 2D bounding box type. (left, bottom, right, top)
Constructors
new_for_circle(p :
Vect, r :
Number) : self
Constructs a BB fitting a circle with the position p and radius r.
SourceConstructs a BB centered on a point with the given extents (half sizes).
SourceInstance methods
area
Returns the area of the bounding box.
Sourcecenter
Returns the center of a bounding box.
Sourceclamp_vect(v : Vect) : Vect
Clamp a vector to a bounding box
Sourcecontains?(other :
BB) :
Bool Returns true if the other BB lies completely within this one.
Sourcecontains?(point :
Vect) :
Bool Returns true if this BB contains the point.
Sourceexpand(point : Vect) : BB
Returns the minimal bounding box that contains both this BB and the point.
Sourceintersects?(other :
BB) :
Bool Returns true if this BB intersects the other.
Sourceintersects_segment?(a :
Vect, b :
Vect) :
Bool Return true if the bounding box intersects the line segment with ends a and b.
Sourcemerge(other : BB) : BB
Returns a bounding box that holds both bounding boxes.
Sourceoffset(v : Vect) : BB
Returns a bounding box offseted by v.
Sourcesegment_query(a :
Vect, b :
Vect) :
Float64 Returns the fraction along the segment query the BB is hit.
Returns INFINITY if it doesn't hit.
Sourcewrap_vect(v : Vect) : Vect
Wrap a vector to a bounding box.
Source