Chipmunk2D Pro API Reference  7.0.3
 All Classes Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Classes | Typedefs | Functions
cpBB

Chipmunk's axis-aligned 2D bounding box type along with a few handy routines. More...

Classes

struct  cpBB
 Chipmunk's axis-aligned 2D bounding box type. (left, bottom, right, top) More...
 

Typedefs

typedef struct cpBB cpBB
 Chipmunk's axis-aligned 2D bounding box type. (left, bottom, right, top)
 

Functions

static cpBB cpBBNew (const cpFloat l, const cpFloat b, const cpFloat r, const cpFloat t)
 Convenience constructor for cpBB structs.
 
static cpBB cpBBNewForExtents (const cpVect c, const cpFloat hw, const cpFloat hh)
 Constructs a cpBB centered on a point with the given extents (half sizes).
 
static cpBB cpBBNewForCircle (const cpVect p, const cpFloat r)
 Constructs a cpBB for a circle with the given position and radius.
 
static cpBool cpBBIntersects (const cpBB a, const cpBB b)
 Returns true if a and b intersect.
 
static cpBool cpBBContainsBB (const cpBB bb, const cpBB other)
 Returns true if other lies completely within bb.
 
static cpBool cpBBContainsVect (const cpBB bb, const cpVect v)
 Returns true if bb contains v.
 
static cpBB cpBBMerge (const cpBB a, const cpBB b)
 Returns a bounding box that holds both bounding boxes.
 
static cpBB cpBBExpand (const cpBB bb, const cpVect v)
 Returns a bounding box that holds both bb and v.
 
static cpVect cpBBCenter (cpBB bb)
 Returns the center of a bounding box.
 
static cpFloat cpBBArea (cpBB bb)
 Returns the area of the bounding box.
 
static cpFloat cpBBMergedArea (cpBB a, cpBB b)
 Merges a and b and returns the area of the merged bounding box.
 
static cpFloat cpBBSegmentQuery (cpBB bb, cpVect a, cpVect b)
 Returns the fraction along the segment query the cpBB is hit. Returns INFINITY if it doesn't hit.
 
static cpBool cpBBIntersectsSegment (cpBB bb, cpVect a, cpVect b)
 Return true if the bounding box intersects the line segment with ends a and b.
 
static cpVect cpBBClampVect (const cpBB bb, const cpVect v)
 Clamp a vector to a bounding box.
 
static cpVect cpBBWrapVect (const cpBB bb, const cpVect v)
 Wrap a vector to a bounding box.
 
static cpBB cpBBOffset (const cpBB bb, const cpVect v)
 Returns a bounding box offseted by v.
 

Detailed Description

Chipmunk's axis-aligned 2D bounding box type along with a few handy routines.