dchip.cpBB

Members

Aliases

cpBBNew
alias cpBBNew = cpBB

Convenience constructor for cpBB structs.

Functions

cpBBArea
cpFloat cpBBArea(cpBB bb)

Returns the area of the bounding box.

cpBBCenter
cpVect cpBBCenter(cpBB bb)

Returns the center of a bounding box.

cpBBClampVect
cpVect cpBBClampVect(const cpBB bb, const cpVect v)

Clamp a vector to a bounding box.

cpBBContainsBB
cpBool cpBBContainsBB(const cpBB bb, const cpBB other)

Returns true if @c other lies completely within @c bb.

cpBBContainsVect
cpBool cpBBContainsVect(const cpBB bb, const cpVect v)

Returns true if @c bb contains @c v.

cpBBExpand
cpBB cpBBExpand(const cpBB bb, const cpVect v)

Returns a bounding box that holds both @c bb and @c v.

cpBBIntersects
cpBool cpBBIntersects(const cpBB a, const cpBB b)

Returns true if @c a and @c b intersect.

cpBBIntersectsSegment
cpBool cpBBIntersectsSegment(cpBB bb, cpVect a, cpVect b)

Return true if the bounding box intersects the line segment with ends @c a and @c b.

cpBBMerge
cpBB cpBBMerge(const cpBB a, const cpBB b)

Returns a bounding box that holds both bounding boxes.

cpBBMergedArea
cpFloat cpBBMergedArea(cpBB a, cpBB b)

Merges @c a and @c b and returns the area of the merged bounding box.

cpBBNewForCircle
cpBB cpBBNewForCircle(const cpVect p, const cpFloat r)

Constructs a cpBB for a circle with the given position and radius.

cpBBSegmentQuery
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.

cpBBWrapVect
cpVect cpBBWrapVect(const cpBB bb, const cpVect v)

Wrap a vector to a bounding box.

Structs

cpBB
struct cpBB

Chipmunk's axis-aligned 2D bounding box type along with a few handy routines. Chipmunk's axis-aligned 2D bounding box type. (left, bottom, right, top)

Meta