Pos2d::
Pos2d is a simple struct, with the members Position[2], an array of floating point numbers indexed as [0] = x, [1] = y, and Angle.
CConvexShape::
void Empty()
Removes all vertices from the convex shape.

void AddVertex(float x, float y)
void AddVertex(float *pos)
Adds a new vertex to the perimeter of the shape, which comes logically after the one that was specified most recently.

AddVertex(float *pos) takes an array, indexed as [0] = x, [1] = y.

void SetPosition(float x, float y, float angle)
void SetPosition(float *pos, float angle)
void SetPosition(Pos2d &p)
Sets the current location and orientation of the convex shape.

AddVertex(float *pos, float angle) takes an array, indexed as [0] = x, [1] = y.

const float *GetEscapeVector(float x, float y)
const float *GetEscapeVector(float *pos)
Return the shortest possible route out of the polygon from location (x, y), or NULL if (x, y) is not in the polygon.

The return result is an array, indexed as [0] = x, [1] = y.

const float *GetSeparation(CConvexShape &Other)
Returns the shortest possible route out of this polygon that could be taken by the CConvexShape ‘Other’, or NULL if the two shapes do not overlap.

Return result is an array, indexed as:
[0], [1]= x, y
[2], [3] = a position where the two shapes will still be in contact after they are separated
[4], [5] = the surface normal at the point of contact

const float *GetBoundingCircle()
Returns the current bounding circle of this convex shape, or NULL if the shape has no geometry. The return result is an array, indexed as [0] = center x, [1] = centre y, [2] = radius.

The result of this function is affected by the current location and orientation of the convex shape.
CRigidBody::
CRigidBody()
CRigidBody(CConvexShape &)
Two constructors are provided for CRigidBody. The first creates a CRigidBody that is not associated with any convex shape in particular. The second connects the CRigidBody to a convex shape.

void Attach(CConvexShape &)
Attaches the CRigidBody to a convex shape.

If it was attached to one before, that connection is severed. If the one it was attached to before was self-allocated then it is freed.

void SetPosition(float x, float y, float angle)
void SetPosition(float *pos, float angle)
void SetPosition(Pos2d &p)
Sets the current position of the rigid body.

The array passed to the middle function is indexed as [0] = x, [1] = y.

void SetVelocity(float x, float y, float angle)
Sets the current linear and angular velocity of the rigid body.

void SetDamping(float linear, float angular)
Sets the linear and angular damping applied to the body at each time step. Each value may range from 1 (no damping) to 0 (complete damping). See CRigidBody::Update for a proper discussion of time steps and damping.

The default value for linear damping is 0.99. The default value for angular damping is 0.995.

void AddForce(const float *force, const float *position)
Applies the given force at the specified position.  Pass NULL for position to make the force act uniformly across the body.

void AddImpulse(const float *separation, const float *position, const float *normal, CRigidBody &other)
void AddImpulse(const float *impulse, CRigidBody &other) 
Applies an impulse to the body, as a result of a collision with another. A negative version of the impulse is simultaneously applied to the other body.

AddImpulse(const float *separation, const float *position, const float *normal…) takes the arguments ‘separation’, being the minimum vector by which this object could be moved so that it no longer overlaps with the other, ‘position’ as the contact point that would remain after separation and ‘normal’ as the surface normal at the contact point.

AddImpulse(const float *impulse…) takes the same information, but as a single floating point array, in exactly the same format as returned by CConvexShape::GetSeparation.

void SetMassInertia(float mass, float inertia)
Sets the mass and inertia of this body. Mass is a measure of how unwilling this body is to move as a result of external stimulus. Higher values mean that the body is more unwilling to move. This value must be non-zero.

Inertia is a measure of how unwilling this body is to rotate as a result of external stimulus. It is the angular analogue of mass. So, higher values mean that the body is more unwilling to rotate. This value must be non-zero.

void SetOneOverMassInertia(float mass, float inertia) 
Sets mass and inertia, but unlike SetMassInertia, you pass 1/mass and 1/inertia as the arguments.

Passing zero for mass creates an object with conceptually infinite mass, i.e. one that never moves no matter what happens to it.

Passing zero for inertia creates an object with conceptually infinite inertia, i.e. one that never rotates no matter what happens to it.

void Push(float x, float y, float a)
Applies a local force to the rigid body, making it accelerate by ‘x’ along its local x-axis, ‘y’ along its local y-axis, and ‘a’ in angular terms.

For example, Push(0, 1, 0) will always make an object accelerate ‘forwards’, regardless of the direction it is currently facing.

bool CollideWith(CRigidBody &Other)
Checks for collisions with the ‘other’ rigid body, adjusting all velocities if one is detected — allowing for mass and inertia of both objects.

If necessary and if possible, it will move both objects slightly so that they are no longer overlapping. This is impossible if both objects have infinite mass.

Returns true if either object was moved, false otherwise.

const float *GetPosition()
float GetAngle() 
Pos2d *GetPos2d()
These three functions provide a way to query the current location and orientation of the rigid body.

GetPosition returns a floating point array, indexed as [0] = x, [1] = y, [2] = angle.

GetAngle returns the current angle as a scalar.

GetPos2d returns the current position as a Pos2d struct.

CConvexShape *GetConvexShape()
Returns a pointer to the convex shape that this rigid body is attached to. If it isn’t attached to any convex shape, then one is allocated and returned.

If a convex shape is allocated then it will be automatically released when the CConvexShape is released.

void Update()
Causes the body to progress in time by one time step. The linear and angular velocities are then multiplied by the linear and angular dampers.

Rigid bodies use a dense Euler integrator and do not check for collisions by themselves.
CBodyCollection::
void AddBody(CRigidBody &)
Adds a body to the collection.

void RemoveBody(CRigidBody &)
Removes a body from the collection.

void Empty()
Removes all bodies from the collection.

void Update()
Advances the collection by one time step — all bodies are advanced  a time step,  and any resulting collisions are handled.