Module Import alias Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Num Num Print AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore AttributeLoad NameLoad attr attr Num Print AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Import alias Import alias Import alias ClassDef bases body Expr Str Assign NameStore ListLoad Str Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Dict Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body If CompareNotEq NameLoad NameLoad body If CompareEq NameLoad NameLoad body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num orelse Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareEq NameLoad Num body Return AttributeLoad NameLoad attr orelse If CompareEq NameLoad Num body Return AttributeLoad NameLoad attr orelse Raise Call NameLoad BinOpAdd BinOpAdd Str Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq NameLoad Num body Assign AttributeStore NameLoad attr NameLoad orelse If CompareEq NameLoad Num body Assign AttributeStore NameLoad attr NameLoad orelse Raise Call NameLoad BinOpAdd BinOpAdd Str Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Print Str NameLoad NameLoad For TupleStore NameStore NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If Call NameLoad NameLoad NameLoad body Return Call NameLoad BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad Str body Return Call NameLoad BinOpAdd AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num BinOpAdd AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num orelse Return Call NameLoad BinOpAdd AttributeLoad NameLoad attr NameLoad BinOpAdd AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body If Call NameLoad NameLoad NameLoad body AugAssignAdd AttributeStore NameLoad attr AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad Str body AugAssignAdd AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num AugAssignAdd AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num orelse AugAssignAdd AttributeStore NameLoad attr NameLoad AugAssignAdd AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If Call NameLoad NameLoad NameLoad body Return Call NameLoad BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad Str body Return Call NameLoad BinOpSub AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num BinOpSub AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num orelse Return Call NameLoad BinOpSub AttributeLoad NameLoad attr NameLoad BinOpSub AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If Call NameLoad NameLoad NameLoad body Return Call NameLoad BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr If Call NameLoad NameLoad Str body Return Call NameLoad BinOpSub SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr BinOpSub SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr orelse Return Call NameLoad BinOpSub NameLoad AttributeLoad NameLoad attr BinOpSub NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body If Call NameLoad NameLoad NameLoad body AugAssignSub AttributeStore NameLoad attr AttributeLoad NameLoad attr AugAssignSub AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad Str body AugAssignSub AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num AugAssignSub AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num orelse AugAssignSub AttributeStore NameLoad attr NameLoad AugAssignSub AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad BinOpSub BinOpMult AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpAdd BinOpMult AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Num Num For NameStore Call NameLoad Num body Assign NameStore Num For NameStore Call NameLoad Num body Assign AttributeStore NameLoad attr Call AttributeLoad Call NameLoad Num Num attr Assign NameStore Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad Num Num Assign AttributeStore NameLoad attr Call AttributeLoad BinOpAdd NameLoad Call AttributeLoad NameLoad attr NameLoad attr Assign NameStore Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AugAssignAdd NameStore BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Str Print BinOpMod Str Call AttributeLoad NameLoad attr keyword Num decorator_list If CompareEq NameLoad Str body Assign NameStore Num If UnaryOpNot NameLoad body Expr Call NameLoad orelse Import alias alias Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Str Str Expr Call AttributeLoad NameLoad attr Num
N/A N/A cffi N/A f N/A N/A cffi FFI N/A N/A N/A f cdef 

typedef double cpFloat;
typedef struct cpVect{cpFloat x,y;} cpVect;
typedef void * cpDataPointer;

static const cpVect cpvzero = {0.0f,0.0f};

typedef struct cpBody cpBody;
/// Rigid body velocity update function type.
typedef void (*cpBodyVelocityFunc)(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt);
/// Rigid body position update function type.
typedef void (*cpBodyPositionFunc)(cpBody *body, cpFloat dt);



struct cpBody {
	/// Function that is called to integrate the body's velocity. (Defaults to cpBodyUpdateVelocity)
	cpBodyVelocityFunc velocity_func;
	
	/// Function that is called to integrate the body's position. (Defaults to cpBodyUpdatePosition)
	cpBodyPositionFunc position_func;
	
	/// Mass of the body.
	/// Must agree with cpBody.m_inv! Use cpBodySetMass() when changing the mass for this reason.
	cpFloat m;
	/// Mass inverse.
	cpFloat m_inv;
	
	/// Moment of inertia of the body.
	/// Must agree with cpBody.i_inv! Use cpBodySetMoment() when changing the moment for this reason.
	cpFloat i;
	/// Moment of inertia inverse.
	cpFloat i_inv;
	
	/// Position of the rigid body's center of gravity.
	cpVect p;
	/// Velocity of the rigid body's center of gravity.
	cpVect v;
	/// Force acting on the rigid body's center of gravity.
	cpVect f;
	
	/// Rotation of the body around it's center of gravity in radians.
	/// Must agree with cpBody.rot! Use cpBodySetAngle() when changing the angle for this reason.
	cpFloat a;
	/// Angular velocity of the body around it's center of gravity in radians/second.
	cpFloat w;
	/// Torque applied to the body around it's center of gravity.
	cpFloat t;
	
	/// Cached unit length vector representing the angle of the body.
	/// Used for fast rotations using cpvrotate().
	cpVect rot;
	
	/// User definable data pointer.
	/// Generally this points to your the game object class so you can access it
	/// when given a cpBody reference in a callback.
	cpDataPointer data;
	
	/// Maximum velocity allowed when updating the velocity.
	cpFloat v_limit;
	/// Maximum rotational rate (in radians/second) allowed when updating the angular velocity.
	cpFloat w_limit;
	
	// CP_PRIVATE(cpVect v_bias);
	// CP_PRIVATE(cpFloat w_bias);
	
	// CP_PRIVATE(cpSpace *space);
	
	// CP_PRIVATE(cpShape *shapeList);
	// CP_PRIVATE(cpArbiter *arbiterList);
	// CP_PRIVATE(cpConstraint *constraintList);
	
	// CP_PRIVATE(cpComponentNode node);
};
/// Allocate a cpBody.
cpBody *cpBodyAlloc(void);
/// Initialize a cpBody.
cpBody *cpBodyInit(cpBody *body, cpFloat m, cpFloat i);
/// Allocate and initialize a cpBody.
cpBody *cpBodyNew(cpFloat m, cpFloat i);


void cpBodySetMass(cpBody *body, cpFloat m);
void cpBodySetMoment(cpBody *body, cpFloat i);
 N/A l N/A N/A f dlopen ./ex.so N/A b N/A N/A l cpBodyNew 3 4 N/A N/A b m N/A N/A b p x N/A N/A N/A b p x 3.5 N/A N/A b m N/A N/A b p x N/A timeit N/A operator N/A math Vec2d N/A N/A N/A 2d vector class, supports vector and scalar operators,
       and also provides some high level functions
        N/A __slots__ N/A x y from_param N/A N/A cls arg N/A N/A N/A Used by ctypes to automatically create Vec2ds N/A N/A cls arg N/A classmethod getd N/A N/A self N/A N/A N/A N/A x y N/A self x N/A self y N/A __init__ N/A N/A self x_or_pair y N/A None None N/A N/A N/A x_or_pair None N/A N/A N/A y None N/A N/A N/A self x N/A x_or_pair N/A 0 N/A N/A self y N/A x_or_pair N/A 1 N/A N/A N/A self x x_or_pair N/A N/A self y y N/A __getitem__ N/A N/A self key N/A N/A N/A N/A key 0 N/A N/A N/A self x N/A N/A N/A key 1 N/A N/A N/A self y N/A N/A N/A IndexError N/A N/A Invalid subscript  N/A str key  to Vec2d N/A __setitem__ N/A N/A self key value N/A N/A N/A N/A key 0 N/A N/A N/A self x value N/A N/A N/A key 1 N/A N/A N/A self y value N/A N/A N/A IndexError N/A N/A Invalid subscript  N/A str key  to Vec2d N/A update N/A N/A self N/A args kwargs N/A N/A update args kwargs N/A N/A k v N/A N/A N/A dict args kwargs iteritems N/A N/A N/A self N/A k v N/A __add__ N/A N/A self other N/A N/A N/A N/A isinstance other Vec2d N/A N/A N/A Vec2d N/A N/A self x N/A other x N/A N/A self y N/A other y N/A N/A N/A hasattr other __getitem__ N/A N/A N/A Vec2d N/A N/A self x N/A other N/A 0 N/A N/A self y N/A other N/A 1 N/A N/A N/A Vec2d N/A N/A self x other N/A N/A self y other N/A N/A __radd__ __add__ __iadd__ N/A N/A self other N/A N/A N/A N/A isinstance other Vec2d N/A N/A N/A self x N/A other x N/A N/A self y N/A other y N/A N/A N/A hasattr other __getitem__ N/A N/A N/A self x N/A other N/A 0 N/A N/A self y N/A other N/A 1 N/A N/A N/A self x other N/A N/A self y other N/A self N/A __sub__ N/A N/A self other N/A N/A N/A N/A isinstance other Vec2d N/A N/A N/A Vec2d N/A N/A self x N/A other x N/A N/A self y N/A other y N/A N/A N/A hasattr other __getitem__ N/A N/A N/A Vec2d N/A N/A self x N/A other N/A 0 N/A N/A self y N/A other N/A 1 N/A N/A N/A Vec2d N/A N/A self x other N/A N/A self y other N/A __rsub__ N/A N/A self other N/A N/A N/A N/A isinstance other Vec2d N/A N/A N/A Vec2d N/A N/A other x N/A self x N/A N/A other y N/A self y N/A N/A hasattr other __getitem__ N/A N/A N/A Vec2d N/A N/A other N/A 0 N/A self x N/A N/A other N/A 1 N/A self y N/A N/A N/A Vec2d N/A other N/A self x N/A other N/A self y N/A __isub__ N/A N/A self other N/A N/A N/A N/A isinstance other Vec2d N/A N/A N/A self x N/A other x N/A N/A self y N/A other y N/A N/A N/A hasattr other __getitem__ N/A N/A N/A self x N/A other N/A 0 N/A N/A self y N/A other N/A 1 N/A N/A N/A self x other N/A N/A self y other N/A self N/A cpvrotate N/A N/A self other N/A N/A N/A Uses complex multiplication to rotate this vector by the other.  N/A N/A Vec2d N/A N/A N/A self x N/A other x N/A N/A self y N/A other y N/A N/A N/A self x N/A other y N/A N/A self y N/A other x N/A N/A run N/A N/A N/A N/A N/A b N/A N/A l cpBodyNew 15 17 N/A x N/A range 20000 N/A N/A s 0 N/A x N/A range 10 N/A N/A N/A b p N/A N/A N/A Vec2d 1 3 getd N/A v1 N/A Vec2d N/A N/A b p x N/A N/A b p y N/A v2 N/A Vec2d 1 3 N/A N/A b p N/A N/A N/A v1 N/A N/A v2 cpvrotate v1 getd N/A v3 N/A Vec2d N/A N/A b p x N/A N/A b p y N/A s N/A N/A v3 x N/A v3 y N/A main N/A N/A N/A N/A N/A t N/A N/A timeit Timer run() from __main__ import run N/A N/A runtime: %.2fs N/A N/A t timeit number 1 N/A N/A N/A __name__ __main__ N/A N/A doprof 0 N/A N/A doprof N/A N/A N/A main N/A N/A cProfile pstats N/A prof N/A N/A cProfile run run() profile.prof N/A stats N/A N/A pstats Stats profile.prof N/A N/A N/A stats strip_dirs N/A N/A N/A stats sort_stats cumulative time calls N/A N/A N/A stats print_stats 30