Chipmunk calloc() alias.
Chipmunk free() alias.
Chipmunk realloc() alias.
Throw when an internal library condition is unsatisfied. Continuing the use of the library after this error is thrown will lead to undefined behavior.
Avoid bringing in std.algorithm.
Calculate area of a hollow circle. @c r1 and @c r2 are the inner and outer diameters. A solid circle has an inner diameter of 0.
Calculate the signed area of a polygon. A Clockwise winding gives positive area. This is probably backwards from what you expect, but matches Chipmunk's the winding for poly shapes.
Calculate the area of a fattened (capsule shaped) line segment.
Throw a DChipError if condition is false.
If the CHIP_ENABLE_WARNINGS version is set, throw a DChipError if condition is false.
If the CHIP_ENABLE_WARNINGS version is set, print a warning to stderr if condition is false.
Calculate the natural centroid of a polygon.
Calculate the convex hull of a given set of points. Returns the count of points in the hull. @c result must be a pointer to a @c cpVect array with at least @c count elements. If @c result is @c NULL, then @c verts will be reduced instead. @c first is an optional pointer to an integer to store where the first vertex in the hull came from (i.e. vertsfirst == result[0]) @c tol is the allowed amount to shrink the hull when simplifying it. A tolerance of 0.0 creates an exact hull. QuickHull seemed like a neat algorithm, and efficient-ish for large input sets. My implementation performs an in place reduction using the result array as scratch space.
@deprecated
Calculate the moment of inertia for a solid box.
Calculate the moment of inertia for a solid box.
Calculate the moment of inertia for a circle. @c r1 and @c r2 are the inner and outer diameters. A solid circle has an inner diameter of 0.
Calculate the moment of inertia for a solid polygon shape assuming it's center of gravity is at it's centroid. The offset is added to each vertex.
Calculate the moment of inertia for a line segment. Beveling radius is not supported.
Center the polygon on the origin. (Subtracts the centroid of the polygon from each vertex)
Allocated size for various Chipmunk buffers.
Chipmunk 6.2.1
Version string.