Chipmunk  6.0.3
Chipmunk API Reference for Kobold2D developers
Basic Types

Defines

#define cpfsqrt   sqrt
#define cpfsin   sin
#define cpfcos   cos
#define cpfacos   acos
#define cpfatan2   atan2
#define cpfmod   fmod
#define cpfexp   exp
#define cpfpow   pow
#define cpffloor   floor
#define cpfceil   ceil
#define INFINITY   (1e1000)
#define M_PI   3.14159265358979323846264338327950288
#define M_E   2.71828182845904523536028747135266250
#define cpTrue   1
 true value.
#define cpFalse   0
 false value.
#define CP_NO_GROUP   ((cpGroup)0)
 Value for cpShape.group signifying that a shape is in no group.
#define CP_ALL_LAYERS   (~(cpLayers)0)
 Value for cpShape.layers signifying that a shape is in every layer.

Typedefs

typedef double cpFloat
typedef uintptr_t cpHashValue
 Hash value type.
typedef int cpBool
 Chipmunk's boolean type.
typedef void * cpDataPointer
 Type used for user data pointers.
typedef uintptr_t cpCollisionType
 Type used for cpSpace.collision_type.
typedef uintptr_t cpGroup
 Type used for cpShape.group.
typedef unsigned int cpLayers
 Type used for cpShape.layers.
typedef unsigned int cpTimestamp
 Type used for various timestamps in Chipmunk.

Functions

static cpFloat cpfmax (cpFloat a, cpFloat b)
 Return the max of two cpFloats.
static cpFloat cpfmin (cpFloat a, cpFloat b)
 Return the min of two cpFloats.
static cpFloat cpfabs (cpFloat f)
 Return the absolute value of a cpFloat.
static cpFloat cpfclamp (cpFloat f, cpFloat min, cpFloat max)
 Clamp f to be between min and max.
static cpFloat cpfclamp01 (cpFloat f)
 Clamp f to be between 0 and 1.
static cpFloat cpflerp (cpFloat f1, cpFloat f2, cpFloat t)
 Linearly interpolate (or extrapolate) between f1 and f2 by t percent.
static cpFloat cpflerpconst (cpFloat f1, cpFloat f2, cpFloat d)
 Linearly interpolate from f1 to f2 by no more than d.

Detailed Description

Most of these types can be configured at compile time.


Define Documentation

#define CP_ALL_LAYERS   (~(cpLayers)0)

Value for cpShape.layers signifying that a shape is in every layer.

#define CP_NO_GROUP   ((cpGroup)0)

Value for cpShape.group signifying that a shape is in no group.

#define cpfacos   acos
#define cpFalse   0

false value.

#define cpfatan2   atan2
#define cpfceil   ceil
#define cpfcos   cos
#define cpfexp   exp
#define cpffloor   floor
#define cpfmod   fmod
#define cpfpow   pow
#define cpfsin   sin
#define cpfsqrt   sqrt
#define cpTrue   1

true value.

#define INFINITY   (1e1000)
#define M_E   2.71828182845904523536028747135266250
#define M_PI   3.14159265358979323846264338327950288

Typedef Documentation

typedef int cpBool

Chipmunk's boolean type.

typedef uintptr_t cpCollisionType

Type used for cpSpace.collision_type.

typedef void* cpDataPointer

Type used for user data pointers.

typedef double cpFloat

Chipmunk's floating point type. Can be reconfigured at compile time.

typedef uintptr_t cpGroup

Type used for cpShape.group.

typedef uintptr_t cpHashValue

Hash value type.

typedef unsigned int cpLayers

Type used for cpShape.layers.

typedef unsigned int cpTimestamp

Type used for various timestamps in Chipmunk.


Function Documentation

static cpFloat cpfabs ( cpFloat  f) [inline, static]

Return the absolute value of a cpFloat.

static cpFloat cpfclamp ( cpFloat  f,
cpFloat  min,
cpFloat  max 
) [inline, static]

Clamp f to be between min and max.

static cpFloat cpfclamp01 ( cpFloat  f) [inline, static]

Clamp f to be between 0 and 1.

static cpFloat cpflerp ( cpFloat  f1,
cpFloat  f2,
cpFloat  t 
) [inline, static]

Linearly interpolate (or extrapolate) between f1 and f2 by t percent.

static cpFloat cpflerpconst ( cpFloat  f1,
cpFloat  f2,
cpFloat  d 
) [inline, static]

Linearly interpolate from f1 to f2 by no more than d.

static cpFloat cpfmax ( cpFloat  a,
cpFloat  b 
) [inline, static]

Return the max of two cpFloats.

static cpFloat cpfmin ( cpFloat  a,
cpFloat  b 
) [inline, static]

Return the min of two cpFloats.