/* Generated by Pyrex 0.9.5.1a on Sun Feb  4 18:20:05 2007 */

#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
__PYX_EXTERN_C double pow(double, double);
#include "stdlib.h"
#include "stdio.h"
#include "ode/ode.h"


typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/

static PyObject *__pyx_m;
static PyObject *__pyx_b;
static int __pyx_lineno;
static char *__pyx_filename;
static char **__pyx_f;

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/

static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static PyObject *__Pyx_GetExcValue(void); /*proto*/

static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/

static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/
static int __Pyx_EndUnpack(PyObject *); /*proto*/

static void __Pyx_WriteUnraisable(char *name); /*proto*/

static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/

static void __Pyx_AddTraceback(char *funcname); /*proto*/

/* Declarations from ode */


struct __pyx_obj_3ode_Mass {
  PyObject_HEAD
  dMass _mass;
};


struct __pyx_obj_3ode_Contact {
  PyObject_HEAD
  dContact _contact;
};


struct __pyx_obj_3ode_World {
  PyObject_HEAD
  dWorldID wid;
};


struct __pyx_obj_3ode_Body {
  PyObject_HEAD
  dBodyID bid;
  PyObject *world;
  PyObject *userattribs;
};


struct __pyx_obj_3ode_JointGroup {
  PyObject_HEAD
  dJointGroupID gid;
  PyObject *jointlist;
};


struct __pyx_obj_3ode_Joint {
  PyObject_HEAD
  dJointID jid;
  PyObject *world;
  dJointFeedback (*feedback);
  PyObject *body1;
  PyObject *body2;
  PyObject *userattribs;
};


struct __pyx_obj_3ode_BallJoint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};


struct __pyx_obj_3ode_HingeJoint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};


struct __pyx_obj_3ode_SliderJoint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};


struct __pyx_obj_3ode_UniversalJoint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};


struct __pyx_obj_3ode_Hinge2Joint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};


struct __pyx_obj_3ode_FixedJoint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};


struct __pyx_obj_3ode_ContactJoint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};


struct __pyx_obj_3ode_AMotor {
  struct __pyx_obj_3ode_Joint __pyx_base;
};


struct __pyx_obj_3ode_LMotor {
  struct __pyx_obj_3ode_Joint __pyx_base;
};


struct __pyx_obj_3ode_Plane2DJoint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};


struct __pyx_obj_3ode_GeomObject {
  PyObject_HEAD
  dGeomID gid;
  PyObject *space;
  PyObject *body;
  PyObject *attribs;
};


struct __pyx_obj_3ode_SpaceBase {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
  dSpaceID sid;
};


struct __pyx_obj_3ode_SimpleSpace {
  struct __pyx_obj_3ode_SpaceBase __pyx_base;
};


struct __pyx_obj_3ode_HashSpace {
  struct __pyx_obj_3ode_SpaceBase __pyx_base;
};


struct __pyx_obj_3ode_QuadTreeSpace {
  struct __pyx_obj_3ode_SpaceBase __pyx_base;
};


struct __pyx_obj_3ode_GeomSphere {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
};


struct __pyx_obj_3ode_GeomBox {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
};


struct __pyx_obj_3ode_GeomPlane {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
};


struct __pyx_obj_3ode_GeomCapsule {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
};


struct __pyx_obj_3ode_GeomCylinder {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
};


struct __pyx_obj_3ode_GeomRay {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
};


struct __pyx_obj_3ode_GeomTransform {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
  PyObject *geom;
};


struct __pyx_obj_3ode_TriMeshData {
  PyObject_HEAD
  dTriMeshDataID tmdid;
  dReal (*vertex_buffer);
  int (*face_buffer);
};


struct __pyx_obj_3ode_GeomTriMesh {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
  struct __pyx_obj_3ode_TriMeshData *data;
};

static PyTypeObject *__pyx_ptype_3ode_Mass = 0;
static PyTypeObject *__pyx_ptype_3ode_Contact = 0;
static PyTypeObject *__pyx_ptype_3ode_World = 0;
static PyTypeObject *__pyx_ptype_3ode_Body = 0;
static PyTypeObject *__pyx_ptype_3ode_JointGroup = 0;
static PyTypeObject *__pyx_ptype_3ode_Joint = 0;
static PyTypeObject *__pyx_ptype_3ode_BallJoint = 0;
static PyTypeObject *__pyx_ptype_3ode_HingeJoint = 0;
static PyTypeObject *__pyx_ptype_3ode_SliderJoint = 0;
static PyTypeObject *__pyx_ptype_3ode_UniversalJoint = 0;
static PyTypeObject *__pyx_ptype_3ode_Hinge2Joint = 0;
static PyTypeObject *__pyx_ptype_3ode_FixedJoint = 0;
static PyTypeObject *__pyx_ptype_3ode_ContactJoint = 0;
static PyTypeObject *__pyx_ptype_3ode_AMotor = 0;
static PyTypeObject *__pyx_ptype_3ode_LMotor = 0;
static PyTypeObject *__pyx_ptype_3ode_Plane2DJoint = 0;
static PyTypeObject *__pyx_ptype_3ode_GeomObject = 0;
static PyTypeObject *__pyx_ptype_3ode_SpaceBase = 0;
static PyTypeObject *__pyx_ptype_3ode_SimpleSpace = 0;
static PyTypeObject *__pyx_ptype_3ode_HashSpace = 0;
static PyTypeObject *__pyx_ptype_3ode_QuadTreeSpace = 0;
static PyTypeObject *__pyx_ptype_3ode_GeomSphere = 0;
static PyTypeObject *__pyx_ptype_3ode_GeomBox = 0;
static PyTypeObject *__pyx_ptype_3ode_GeomPlane = 0;
static PyTypeObject *__pyx_ptype_3ode_GeomCapsule = 0;
static PyTypeObject *__pyx_ptype_3ode_GeomCylinder = 0;
static PyTypeObject *__pyx_ptype_3ode_GeomRay = 0;
static PyTypeObject *__pyx_ptype_3ode_GeomTransform = 0;
static PyTypeObject *__pyx_ptype_3ode_TriMeshData = 0;
static PyTypeObject *__pyx_ptype_3ode_GeomTriMesh = 0;
static PyObject *__pyx_k2;
static PyObject *__pyx_k3;
static PyObject *__pyx_k4;
static PyObject *__pyx_k5;
static PyObject *__pyx_k6;
static PyObject *__pyx_k7;
static PyObject *__pyx_k8;
static PyObject *__pyx_k9;
static PyObject *__pyx_k10;
static PyObject *__pyx_k11;
static PyObject *__pyx_k12;
static PyObject *__pyx_k13;
static PyObject *__pyx_k14;
static PyObject *__pyx_k15;
static PyObject *__pyx_k16;
static PyObject *__pyx_k17;
static PyObject *__pyx_k18;
static PyObject *__pyx_k19;
static PyObject *__pyx_k20;
static PyObject *__pyx_k21;
static PyObject *__pyx_k22;
static PyObject *__pyx_k25;
static PyObject *__pyx_k26;
static PyObject *__pyx_k27;
static PyObject *__pyx_k28;
static PyObject *__pyx_k29;
static PyObject *__pyx_k30;
static PyObject *__pyx_k31;
static PyObject *__pyx_k32;
static PyObject *__pyx_k33;
static PyObject *__pyx_k34;
static PyObject *__pyx_k35;
static PyObject *__pyx_k36;
static PyObject *__pyx_k37;
static PyObject *__pyx_k38;
static PyObject *__pyx_k39;
static PyObject *__pyx_k40;
static PyObject *__pyx_k41;
static PyObject *__pyx_k42;
static PyObject *__pyx_k43;
static PyObject *__pyx_k44;
static PyObject *__pyx_k45;
static PyObject *__pyx_k46;
static PyObject *__pyx_k47;
static PyObject *__pyx_k48;
static PyObject *__pyx_k49;
static PyObject *__pyx_k50;
static PyObject *__pyx_k51;
static PyObject *__pyx_k52;
static PyObject *__pyx_k53;
static PyObject *__pyx_k54;
static PyObject *__pyx_k55;
static PyObject *__pyx_k56;
static PyObject *__pyx_k57;
static PyObject *__pyx_k58;
static PyObject *__pyx_k59;
static PyObject *__pyx_k60;
static PyObject *__pyx_k61;
static PyObject *__pyx_k62;
static PyObject *__pyx_k63;
static PyObject *__pyx_k64;
static PyObject *__pyx_k65;
static void (__pyx_f_3ode_collide_callback(void (*),dGeomID ,dGeomID )); /*proto*/


/* Implementation of ode */

static char (__pyx_k1[]) = "Python Open Dynamics Engine (ODE) wrapper.\n\nThis module contains classes and functions that wrap the functionality\nof the Open Dynamics Engine (ODE) which can be found at \nhttp://opende.sourceforge.net.\n\nThere are the following classes and functions:\n\n - World\n - Body\n - JointGroup\n - Contact\n - Space\n - Mass\n\nJoint classes:\n\n - BallJoint\n - HingeJoint\n - Hinge2Joint\n - SliderJoint\n - UniversalJoint\n - FixedJoint\n - ContactJoint\n - AMotor\n - LMotor\n - Plane2DJoint\n\nGeom classes:\n\n - GeomSphere\n - GeomBox\n - GeomPlane\n - GeomCapsule\n - GeomCylinder\n - GeomRay\n - GeomTransform\n - GeomTriMesh / TriMeshData\n\nFunctions:\n\n - CloseODE()\n - collide()\n\n";
static char (__pyx_k24[]) = "Iterates over the geoms inside a Space.\n    ";

static PyObject *__pyx_n___doc__;
static PyObject *__pyx_n_paramLoStop;
static PyObject *__pyx_n_paramHiStop;
static PyObject *__pyx_n_paramVel;
static PyObject *__pyx_n_paramFMax;
static PyObject *__pyx_n_paramFudgeFactor;
static PyObject *__pyx_n_paramBounce;
static PyObject *__pyx_n_paramCFM;
static PyObject *__pyx_n_paramStopERP;
static PyObject *__pyx_n_paramStopCFM;
static PyObject *__pyx_n_paramSuspensionERP;
static PyObject *__pyx_n_paramSuspensionCFM;
static PyObject *__pyx_n_ParamLoStop;
static PyObject *__pyx_n_ParamHiStop;
static PyObject *__pyx_n_ParamVel;
static PyObject *__pyx_n_ParamFMax;
static PyObject *__pyx_n_ParamFudgeFactor;
static PyObject *__pyx_n_ParamBounce;
static PyObject *__pyx_n_ParamCFM;
static PyObject *__pyx_n_ParamStopERP;
static PyObject *__pyx_n_ParamStopCFM;
static PyObject *__pyx_n_ParamSuspensionERP;
static PyObject *__pyx_n_ParamSuspensionCFM;
static PyObject *__pyx_n_ParamLoStop2;
static PyObject *__pyx_n_ParamHiStop2;
static PyObject *__pyx_n_ParamVel2;
static PyObject *__pyx_n_ParamFMax2;
static PyObject *__pyx_n_ParamFudgeFactor2;
static PyObject *__pyx_n_ParamBounce2;
static PyObject *__pyx_n_ParamCFM2;
static PyObject *__pyx_n_ParamStopERP2;
static PyObject *__pyx_n_ParamStopCFM2;
static PyObject *__pyx_n_ParamSuspensionERP2;
static PyObject *__pyx_n_ParamSuspensionCFM2;
static PyObject *__pyx_n_ParamLoStop3;
static PyObject *__pyx_n_ParamHiStop3;
static PyObject *__pyx_n_ParamVel3;
static PyObject *__pyx_n_ParamFMax3;
static PyObject *__pyx_n_ParamFudgeFactor3;
static PyObject *__pyx_n_ParamBounce3;
static PyObject *__pyx_n_ParamCFM3;
static PyObject *__pyx_n_ParamStopERP3;
static PyObject *__pyx_n_ParamStopCFM3;
static PyObject *__pyx_n_ParamSuspensionERP3;
static PyObject *__pyx_n_ParamSuspensionCFM3;
static PyObject *__pyx_n_ParamGroup;
static PyObject *__pyx_n_ContactMu2;
static PyObject *__pyx_n_ContactFDir1;
static PyObject *__pyx_n_ContactBounce;
static PyObject *__pyx_n_ContactSoftERP;
static PyObject *__pyx_n_ContactSoftCFM;
static PyObject *__pyx_n_ContactMotion1;
static PyObject *__pyx_n_ContactMotion2;
static PyObject *__pyx_n_ContactSlip1;
static PyObject *__pyx_n_ContactSlip2;
static PyObject *__pyx_n_ContactApprox0;
static PyObject *__pyx_n_ContactApprox1_1;
static PyObject *__pyx_n_ContactApprox1_2;
static PyObject *__pyx_n_ContactApprox1;
static PyObject *__pyx_n_AMotorUser;
static PyObject *__pyx_n_AMotorEuler;
static PyObject *__pyx_n_Infinity;
static PyObject *__pyx_n__geom_c2py_lut;
static PyObject *__pyx_n__SpaceIterator;
static PyObject *__pyx_n_Space;
static PyObject *__pyx_n_GeomCCylinder;
static PyObject *__pyx_n_collide;
static PyObject *__pyx_n_collide2;
static PyObject *__pyx_n_areConnected;
static PyObject *__pyx_n_CloseODE;
static PyObject *__pyx_n_environment;
static PyObject *__pyx_n___init__;
static PyObject *__pyx_n___iter__;
static PyObject *__pyx_n_next;

static PyObject *__pyx_k1p;
static PyObject *__pyx_k24p;

static int __pyx_f_3ode_4Mass___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_4Mass___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/mass.pyx":44 */
  dMassSetZero((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass));

  __pyx_r = 0;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Mass_setZero(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Mass_setZero[] = "setZero()\n\n        Set all the mass parameters to zero.";
static PyObject *__pyx_f_3ode_4Mass_setZero(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/mass.pyx":50 */
  dMassSetZero((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass));

  __pyx_r = Py_None; Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Mass_setParameters(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Mass_setParameters[] = "setParameters(mass, cgx, cgy, cgz, I11, I22, I33, I12, I13, I23)\n\n        Set the mass parameters to the given values.\n\n        @param mass: Total mass of the body.\n        @param cgx: Center of gravity position in the body frame (x component).\n        @param cgy: Center of gravity position in the body frame (y component).\n        @param cgz: Center of gravity position in the body frame (z component).\n        @param I11: Inertia tensor\n        @param I22: Inertia tensor\n        @param I33: Inertia tensor\n        @param I12: Inertia tensor\n        @param I13: Inertia tensor\n        @param I23: Inertia tensor\n        @type mass: float\n        @type cgx: float\n        @type cgy: float\n        @type cgz: float\n        @type I11: float\n        @type I22: float\n        @type I33: float\n        @type I12: float\n        @type I13: float\n        @type I23: float\n        ";
static PyObject *__pyx_f_3ode_4Mass_setParameters(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mass = 0;
  PyObject *__pyx_v_cgx = 0;
  PyObject *__pyx_v_cgy = 0;
  PyObject *__pyx_v_cgz = 0;
  PyObject *__pyx_v_I11 = 0;
  PyObject *__pyx_v_I22 = 0;
  PyObject *__pyx_v_I33 = 0;
  PyObject *__pyx_v_I12 = 0;
  PyObject *__pyx_v_I13 = 0;
  PyObject *__pyx_v_I23 = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  dReal __pyx_2;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  dReal __pyx_6;
  dReal __pyx_7;
  dReal __pyx_8;
  dReal __pyx_9;
  dReal __pyx_10;
  static char *__pyx_argnames[] = {"mass","cgx","cgy","cgz","I11","I22","I33","I12","I13","I23",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOOOOOOO", __pyx_argnames, &__pyx_v_mass, &__pyx_v_cgx, &__pyx_v_cgy, &__pyx_v_cgz, &__pyx_v_I11, &__pyx_v_I22, &__pyx_v_I33, &__pyx_v_I12, &__pyx_v_I13, &__pyx_v_I23)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_mass);
  Py_INCREF(__pyx_v_cgx);
  Py_INCREF(__pyx_v_cgy);
  Py_INCREF(__pyx_v_cgz);
  Py_INCREF(__pyx_v_I11);
  Py_INCREF(__pyx_v_I22);
  Py_INCREF(__pyx_v_I33);
  Py_INCREF(__pyx_v_I12);
  Py_INCREF(__pyx_v_I13);
  Py_INCREF(__pyx_v_I23);

  /* "/home/zefiris/pyode/src/mass.pyx":78 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_mass); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_cgx); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_cgy); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_cgz); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
  __pyx_5 = PyFloat_AsDouble(__pyx_v_I11); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
  __pyx_6 = PyFloat_AsDouble(__pyx_v_I22); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
  __pyx_7 = PyFloat_AsDouble(__pyx_v_I33); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
  __pyx_8 = PyFloat_AsDouble(__pyx_v_I12); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
  __pyx_9 = PyFloat_AsDouble(__pyx_v_I13); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
  __pyx_10 = PyFloat_AsDouble(__pyx_v_I23); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
  dMassSetParameters((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_1,__pyx_2,__pyx_3,__pyx_4,__pyx_5,__pyx_6,__pyx_7,__pyx_8,__pyx_9,__pyx_10);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Mass.setParameters");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_mass);
  Py_DECREF(__pyx_v_cgx);
  Py_DECREF(__pyx_v_cgy);
  Py_DECREF(__pyx_v_cgz);
  Py_DECREF(__pyx_v_I11);
  Py_DECREF(__pyx_v_I22);
  Py_DECREF(__pyx_v_I33);
  Py_DECREF(__pyx_v_I12);
  Py_DECREF(__pyx_v_I13);
  Py_DECREF(__pyx_v_I23);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Mass_setSphere(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Mass_setSphere[] = "setSphere(density, radius)\n        \n        Set the mass parameters to represent a sphere of the given radius\n        and density, with the center of mass at (0,0,0) relative to the body.\n\n        @param density: The density of the sphere\n        @param radius: The radius of the sphere\n        @type density: float\n        @type radius: float\n        ";
static PyObject *__pyx_f_3ode_4Mass_setSphere(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_density = 0;
  PyObject *__pyx_v_radius = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"density","radius",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_density, &__pyx_v_radius)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_density);
  Py_INCREF(__pyx_v_radius);

  /* "/home/zefiris/pyode/src/mass.pyx":91 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_density); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
  dMassSetSphere((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Mass.setSphere");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_density);
  Py_DECREF(__pyx_v_radius);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Mass_setSphereTotal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Mass_setSphereTotal[] = "setSphereTotal(total_mass, radius)\n        \n        Set the mass parameters to represent a sphere of the given radius\n        and mass, with the center of mass at (0,0,0) relative to the body.\n\n        @param total_mass: The total mass of the sphere\n        @param radius: The radius of the sphere\n        @type total_mass: float\n        @type radius: float\n        ";
static PyObject *__pyx_f_3ode_4Mass_setSphereTotal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_total_mass = 0;
  PyObject *__pyx_v_radius = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"total_mass","radius",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_total_mass, &__pyx_v_radius)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_total_mass);
  Py_INCREF(__pyx_v_radius);

  /* "/home/zefiris/pyode/src/mass.pyx":104 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_total_mass); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
  dMassSetSphere((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Mass.setSphereTotal");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_total_mass);
  Py_DECREF(__pyx_v_radius);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Mass_setCappedCylinder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Mass_setCappedCylinder[] = "setCappedCylinder(density, direction, r, h)\n        \n        Set the mass parameters to represent a capped cylinder of the\n        given parameters and density, with the center of mass at\n        (0,0,0) relative to the body. The radius of the cylinder (and\n        the spherical cap) is r. The length of the cylinder (not\n        counting the spherical cap) is h. The cylinder\'s long axis is\n        oriented along the body\'s x, y or z axis according to the\n        value of direction (1=x, 2=y, 3=z).\n\n        @param density: The density of the cylinder\n        @param direction: The direction of the cylinder (1=x axis, 2=y axis, 3=z axis)\n        @param r: The radius of the cylinder\n        @param h: The length of the cylinder (without the caps)\n        @type density: float\n        @type direction: int\n        @type r: float\n        @type h: float\n        ";
static PyObject *__pyx_f_3ode_4Mass_setCappedCylinder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_density = 0;
  PyObject *__pyx_v_direction = 0;
  PyObject *__pyx_v_r = 0;
  PyObject *__pyx_v_h = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  int __pyx_2;
  dReal __pyx_3;
  dReal __pyx_4;
  static char *__pyx_argnames[] = {"density","direction","r","h",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO", __pyx_argnames, &__pyx_v_density, &__pyx_v_direction, &__pyx_v_r, &__pyx_v_h)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_density);
  Py_INCREF(__pyx_v_direction);
  Py_INCREF(__pyx_v_r);
  Py_INCREF(__pyx_v_h);

  /* "/home/zefiris/pyode/src/mass.pyx":126 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_density); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_v_direction); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_r); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_h); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;}
  dMassSetCappedCylinder((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_1,__pyx_2,__pyx_3,__pyx_4);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Mass.setCappedCylinder");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_density);
  Py_DECREF(__pyx_v_direction);
  Py_DECREF(__pyx_v_r);
  Py_DECREF(__pyx_v_h);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Mass_setCappedCylinderTotal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Mass_setCappedCylinderTotal[] = "setCappedCylinderTotal(total_mass, direction, r, h)\n        \n        Set the mass parameters to represent a capped cylinder of the\n        given parameters and mass, with the center of mass at\n        (0,0,0) relative to the body. The radius of the cylinder (and\n        the spherical cap) is r. The length of the cylinder (not\n        counting the spherical cap) is h. The cylinder\'s long axis is\n        oriented along the body\'s x, y or z axis according to the\n        value of direction (1=x, 2=y, 3=z).\n\n        @param total_mass: The total mass of the cylinder\n        @param direction: The direction of the cylinder (1=x axis, 2=y axis, 3=z axis)\n        @param r: The radius of the cylinder\n        @param h: The length of the cylinder (without the caps)\n        @type total_mass: float\n        @type direction: int\n        @type r: float\n        @type h: float\n        ";
static PyObject *__pyx_f_3ode_4Mass_setCappedCylinderTotal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_total_mass = 0;
  PyObject *__pyx_v_direction = 0;
  PyObject *__pyx_v_r = 0;
  PyObject *__pyx_v_h = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  int __pyx_2;
  dReal __pyx_3;
  dReal __pyx_4;
  static char *__pyx_argnames[] = {"total_mass","direction","r","h",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO", __pyx_argnames, &__pyx_v_total_mass, &__pyx_v_direction, &__pyx_v_r, &__pyx_v_h)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_total_mass);
  Py_INCREF(__pyx_v_direction);
  Py_INCREF(__pyx_v_r);
  Py_INCREF(__pyx_v_h);

  /* "/home/zefiris/pyode/src/mass.pyx":148 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_total_mass); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_v_direction); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_r); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_h); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
  dMassSetCappedCylinderTotal((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_1,__pyx_2,__pyx_3,__pyx_4);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Mass.setCappedCylinderTotal");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_total_mass);
  Py_DECREF(__pyx_v_direction);
  Py_DECREF(__pyx_v_r);
  Py_DECREF(__pyx_v_h);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Mass_setCylinder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Mass_setCylinder[] = "setCylinder(density, direction, r, h)\n        \n        Set the mass parameters to represent a flat-ended cylinder of\n        the given parameters and density, with the center of mass at\n        (0,0,0) relative to the body. The radius of the cylinder is r.\n        The length of the cylinder is h. The cylinder\'s long axis is\n        oriented along the body\'s x, y or z axis according to the value\n        of direction (1=x, 2=y, 3=z).\n\n        @param density: The density of the cylinder\n        @param direction: The direction of the cylinder (1=x axis, 2=y axis, 3=z axis)\n        @param r: The radius of the cylinder\n        @param h: The length of the cylinder\n        @type density: float\n        @type direction: int\n        @type r: float\n        @type h: float\n        ";
static PyObject *__pyx_f_3ode_4Mass_setCylinder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_density = 0;
  PyObject *__pyx_v_direction = 0;
  PyObject *__pyx_v_r = 0;
  PyObject *__pyx_v_h = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  int __pyx_2;
  dReal __pyx_3;
  dReal __pyx_4;
  static char *__pyx_argnames[] = {"density","direction","r","h",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO", __pyx_argnames, &__pyx_v_density, &__pyx_v_direction, &__pyx_v_r, &__pyx_v_h)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_density);
  Py_INCREF(__pyx_v_direction);
  Py_INCREF(__pyx_v_r);
  Py_INCREF(__pyx_v_h);

  /* "/home/zefiris/pyode/src/mass.pyx":169 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_density); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_v_direction); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_r); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_h); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;}
  dMassSetCylinder((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_1,__pyx_2,__pyx_3,__pyx_4);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Mass.setCylinder");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_density);
  Py_DECREF(__pyx_v_direction);
  Py_DECREF(__pyx_v_r);
  Py_DECREF(__pyx_v_h);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Mass_setCylinderTotal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Mass_setCylinderTotal[] = "setCylinderTotal(total_mass, direction, r, h)\n        \n        Set the mass parameters to represent a flat-ended cylinder of\n        the given parameters and mass, with the center of mass at\n        (0,0,0) relative to the body. The radius of the cylinder is r.\n        The length of the cylinder is h. The cylinder\'s long axis is\n        oriented along the body\'s x, y or z axis according to the value\n        of direction (1=x, 2=y, 3=z).\n\n        @param total_mass: The total mass of the cylinder\n        @param direction: The direction of the cylinder (1=x axis, 2=y axis, 3=z axis)\n        @param r: The radius of the cylinder\n        @param h: The length of the cylinder\n        @type total_mass: float\n        @type direction: int\n        @type r: float\n        @type h: float\n        ";
static PyObject *__pyx_f_3ode_4Mass_setCylinderTotal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_total_mass = 0;
  PyObject *__pyx_v_direction = 0;
  PyObject *__pyx_v_r = 0;
  PyObject *__pyx_v_h = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  int __pyx_2;
  dReal __pyx_3;
  dReal __pyx_4;
  static char *__pyx_argnames[] = {"total_mass","direction","r","h",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO", __pyx_argnames, &__pyx_v_total_mass, &__pyx_v_direction, &__pyx_v_r, &__pyx_v_h)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_total_mass);
  Py_INCREF(__pyx_v_direction);
  Py_INCREF(__pyx_v_r);
  Py_INCREF(__pyx_v_h);

  /* "/home/zefiris/pyode/src/mass.pyx":190 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_total_mass); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_v_direction); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_r); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_h); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
  dMassSetCylinderTotal((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_1,__pyx_2,__pyx_3,__pyx_4);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Mass.setCylinderTotal");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_total_mass);
  Py_DECREF(__pyx_v_direction);
  Py_DECREF(__pyx_v_r);
  Py_DECREF(__pyx_v_h);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Mass_setBox(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Mass_setBox[] = "setBox(density, lx, ly, lz)\n\n        Set the mass parameters to represent a box of the given\n        dimensions and density, with the center of mass at (0,0,0)\n        relative to the body. The side lengths of the box along the x,\n        y and z axes are lx, ly and lz.\n\n        @param density: The density of the box\n        @param lx: The length along the x axis\n        @param ly: The length along the y axis\n        @param lz: The length along the z axis\n        @type density: float\n        @type lx: float\n        @type ly: float\n        @type lz: float\n        ";
static PyObject *__pyx_f_3ode_4Mass_setBox(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_density = 0;
  PyObject *__pyx_v_lx = 0;
  PyObject *__pyx_v_ly = 0;
  PyObject *__pyx_v_lz = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  dReal __pyx_2;
  dReal __pyx_3;
  dReal __pyx_4;
  static char *__pyx_argnames[] = {"density","lx","ly","lz",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO", __pyx_argnames, &__pyx_v_density, &__pyx_v_lx, &__pyx_v_ly, &__pyx_v_lz)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_density);
  Py_INCREF(__pyx_v_lx);
  Py_INCREF(__pyx_v_ly);
  Py_INCREF(__pyx_v_lz);

  /* "/home/zefiris/pyode/src/mass.pyx":209 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_density); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_lx); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_ly); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_lz); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;}
  dMassSetBox((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_1,__pyx_2,__pyx_3,__pyx_4);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Mass.setBox");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_density);
  Py_DECREF(__pyx_v_lx);
  Py_DECREF(__pyx_v_ly);
  Py_DECREF(__pyx_v_lz);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Mass_setBoxTotal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Mass_setBoxTotal[] = "setBoxTotal(total_mass, lx, ly, lz)\n\n        Set the mass parameters to represent a box of the given\n        dimensions and mass, with the center of mass at (0,0,0)\n        relative to the body. The side lengths of the box along the x,\n        y and z axes are lx, ly and lz.\n\n        @param total_mass: The total mass of the box\n        @param lx: The length along the x axis\n        @param ly: The length along the y axis\n        @param lz: The length along the z axis\n        @type total_mass: float\n        @type lx: float\n        @type ly: float\n        @type lz: float\n        ";
static PyObject *__pyx_f_3ode_4Mass_setBoxTotal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_total_mass = 0;
  PyObject *__pyx_v_lx = 0;
  PyObject *__pyx_v_ly = 0;
  PyObject *__pyx_v_lz = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  dReal __pyx_2;
  dReal __pyx_3;
  dReal __pyx_4;
  static char *__pyx_argnames[] = {"total_mass","lx","ly","lz",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO", __pyx_argnames, &__pyx_v_total_mass, &__pyx_v_lx, &__pyx_v_ly, &__pyx_v_lz)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_total_mass);
  Py_INCREF(__pyx_v_lx);
  Py_INCREF(__pyx_v_ly);
  Py_INCREF(__pyx_v_lz);

  /* "/home/zefiris/pyode/src/mass.pyx":228 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_total_mass); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_lx); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_ly); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_lz); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
  dMassSetBoxTotal((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_1,__pyx_2,__pyx_3,__pyx_4);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Mass.setBoxTotal");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_total_mass);
  Py_DECREF(__pyx_v_lx);
  Py_DECREF(__pyx_v_ly);
  Py_DECREF(__pyx_v_lz);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Mass_adjust(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Mass_adjust[] = "adjust(newmass)\n\n        Adjust the total mass. Given mass parameters for some object,\n        adjust them so the total mass is now newmass. This is useful\n        when using the setXyz() methods to set the mass parameters for\n        certain objects - they take the object density, not the total\n        mass.\n\n        @param newmass: The new total mass\n        @type newmass: float\n        ";
static PyObject *__pyx_f_3ode_4Mass_adjust(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_newmass = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"newmass",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_newmass)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_newmass);

  /* "/home/zefiris/pyode/src/mass.pyx":242 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_newmass); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; goto __pyx_L1;}
  dMassAdjust((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Mass.adjust");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_newmass);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Mass_translate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Mass_translate[] = "translate(t)\n\n        Adjust mass parameters. Given mass parameters for some object,\n        adjust them to represent the object displaced by (x,y,z)\n        relative to the body frame.\n\n        @param t: Translation vector (x, y, z)\n        @type t: 3-tuple of floats\n        ";
static PyObject *__pyx_f_3ode_4Mass_translate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_t = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"t",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_t)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_t);

  /* "/home/zefiris/pyode/src/mass.pyx":254 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dMassTranslate((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Mass.translate");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_t);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Mass_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Mass_add[] = "add(b)\n\n        Add the mass b to the mass object. Masses can also be added using\n        the + operator.\n\n        @param b: The mass to add to this mass\n        @type b: Mass\n        ";
static PyObject *__pyx_f_3ode_4Mass_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_Mass *__pyx_v_b = 0;
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {"b",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_b)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_b);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_3ode_Mass, 1, "b")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/mass.pyx":272 */
  dMassAdd((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),(&__pyx_v_b->_mass));

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Mass.add");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_b);
  return __pyx_r;
}

static PyObject *__pyx_n_mass;
static PyObject *__pyx_n_c;
static PyObject *__pyx_n_I;
static PyObject *__pyx_n_AttributeError;

static PyObject *__pyx_k69p;
static PyObject *__pyx_k70p;

static char (__pyx_k69[]) = "Mass object has no attribute '";
static char (__pyx_k70[]) = "\'";

static PyObject *__pyx_f_3ode_4Mass___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_f_3ode_4Mass___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_name);

  /* "/home/zefiris/pyode/src/mass.pyx":275 */
  if (PyObject_Cmp(__pyx_v_name, __pyx_n_mass, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/mass.pyx":276 */
    __pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.mass); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  if (PyObject_Cmp(__pyx_v_name, __pyx_n_c, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/mass.pyx":278 */
    __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.c[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
    __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.c[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
    __pyx_4 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.c[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
    PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
    PyTuple_SET_ITEM(__pyx_5, 2, __pyx_4);
    __pyx_2 = 0;
    __pyx_3 = 0;
    __pyx_4 = 0;
    __pyx_r = __pyx_5;
    __pyx_5 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  if (PyObject_Cmp(__pyx_v_name, __pyx_n_I, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/mass.pyx":280 */
    __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}
    __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}
    __pyx_4 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
    PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
    PyTuple_SET_ITEM(__pyx_5, 2, __pyx_4);
    __pyx_2 = 0;
    __pyx_3 = 0;
    __pyx_4 = 0;
    __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[4])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;}
    __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[5])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;}
    __pyx_4 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[6])); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;}
    __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2);
    PyTuple_SET_ITEM(__pyx_6, 1, __pyx_3);
    PyTuple_SET_ITEM(__pyx_6, 2, __pyx_4);
    __pyx_2 = 0;
    __pyx_3 = 0;
    __pyx_4 = 0;
    __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[8])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;}
    __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[9])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;}
    __pyx_4 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[10])); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;}
    __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_7, 0, __pyx_2);
    PyTuple_SET_ITEM(__pyx_7, 1, __pyx_3);
    PyTuple_SET_ITEM(__pyx_7, 2, __pyx_4);
    __pyx_2 = 0;
    __pyx_3 = 0;
    __pyx_4 = 0;
    __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
    PyTuple_SET_ITEM(__pyx_2, 1, __pyx_6);
    PyTuple_SET_ITEM(__pyx_2, 2, __pyx_7);
    __pyx_5 = 0;
    __pyx_6 = 0;
    __pyx_7 = 0;
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/zefiris/pyode/src/mass.pyx":284 */
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;}
    __pyx_4 = PyNumber_Add(__pyx_k69p, __pyx_v_name); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;}
    __pyx_5 = PyNumber_Add(__pyx_4, __pyx_k70p); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __Pyx_Raise(__pyx_3, __pyx_5, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;}
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("ode.Mass.__getattr__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_name);
  return __pyx_r;
}

static PyObject *__pyx_n_adjust;

static PyObject *__pyx_k73p;
static PyObject *__pyx_k75p;
static PyObject *__pyx_k76p;
static PyObject *__pyx_k77p;

static char (__pyx_k73[]) = "Use the setParameter() method to change c";
static char (__pyx_k75[]) = "Use the setParameter() method to change I";
static char (__pyx_k76[]) = "Mass object has no attribute '";
static char (__pyx_k77[]) = "\'";

static int __pyx_f_3ode_4Mass___setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /*proto*/
static int __pyx_f_3ode_4Mass___setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_name);
  Py_INCREF(__pyx_v_value);

  /* "/home/zefiris/pyode/src/mass.pyx":287 */
  if (PyObject_Cmp(__pyx_v_name, __pyx_n_mass, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/mass.pyx":288 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_adjust); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;}
    Py_INCREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_value);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L2;
  }
  if (PyObject_Cmp(__pyx_v_name, __pyx_n_c, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/mass.pyx":290 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k73p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; goto __pyx_L1;}
    goto __pyx_L2;
  }
  if (PyObject_Cmp(__pyx_v_name, __pyx_n_I, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/mass.pyx":292 */
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; goto __pyx_L1;}
    __Pyx_Raise(__pyx_3, __pyx_k75p, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; goto __pyx_L1;}
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/zefiris/pyode/src/mass.pyx":294 */
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; goto __pyx_L1;}
    __pyx_2 = PyNumber_Add(__pyx_k76p, __pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; goto __pyx_L1;}
    __pyx_3 = PyNumber_Add(__pyx_2, __pyx_k77p); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __Pyx_Raise(__pyx_4, __pyx_3, 0);
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; goto __pyx_L1;}
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Mass.__setattr__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_name);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}

static PyObject *__pyx_n_add;

static PyObject *__pyx_f_3ode_4Mass___add__(PyObject *__pyx_v_self, PyObject *__pyx_v_b); /*proto*/
static PyObject *__pyx_f_3ode_4Mass___add__(PyObject *__pyx_v_self, PyObject *__pyx_v_b) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_b);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_3ode_Mass, 1, "b")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/mass.pyx":297 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_add); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; goto __pyx_L1;}
  Py_INCREF(__pyx_v_b);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_b);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/zefiris/pyode/src/mass.pyx":298 */
  Py_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.Mass.__add__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_b);
  return __pyx_r;
}

static PyObject *__pyx_n_str;

static PyObject *__pyx_k78p;

static char (__pyx_k78[]) = "Mass=%s\nCg=(%s, %s, %s)\nI11=%s I22=%s I33=%s\nI12=%s I13=%s I23=%s";

static PyObject *__pyx_f_3ode_4Mass___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_3ode_4Mass___str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_v_m;
  PyObject *__pyx_v_sc0;
  PyObject *__pyx_v_sc1;
  PyObject *__pyx_v_sc2;
  PyObject *__pyx_v_I11;
  PyObject *__pyx_v_I22;
  PyObject *__pyx_v_I33;
  PyObject *__pyx_v_I12;
  PyObject *__pyx_v_I13;
  PyObject *__pyx_v_I23;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  Py_INCREF(__pyx_v_self);
  __pyx_v_m = Py_None; Py_INCREF(Py_None);
  __pyx_v_sc0 = Py_None; Py_INCREF(Py_None);
  __pyx_v_sc1 = Py_None; Py_INCREF(Py_None);
  __pyx_v_sc2 = Py_None; Py_INCREF(Py_None);
  __pyx_v_I11 = Py_None; Py_INCREF(Py_None);
  __pyx_v_I22 = Py_None; Py_INCREF(Py_None);
  __pyx_v_I33 = Py_None; Py_INCREF(Py_None);
  __pyx_v_I12 = Py_None; Py_INCREF(Py_None);
  __pyx_v_I13 = Py_None; Py_INCREF(Py_None);
  __pyx_v_I23 = Py_None; Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/mass.pyx":301 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.mass); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
  __pyx_2 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_m);
  __pyx_v_m = __pyx_2;
  __pyx_2 = 0;

  /* "/home/zefiris/pyode/src/mass.pyx":302 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.c[0])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_sc0);
  __pyx_v_sc0 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/zefiris/pyode/src/mass.pyx":303 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.c[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
  __pyx_2 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_sc1);
  __pyx_v_sc1 = __pyx_2;
  __pyx_2 = 0;

  /* "/home/zefiris/pyode/src/mass.pyx":304 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.c[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_sc2);
  __pyx_v_sc2 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/zefiris/pyode/src/mass.pyx":305 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
  __pyx_2 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_I11);
  __pyx_v_I11 = __pyx_2;
  __pyx_2 = 0;

  /* "/home/zefiris/pyode/src/mass.pyx":306 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[5])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_I22);
  __pyx_v_I22 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/zefiris/pyode/src/mass.pyx":307 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[10])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
  __pyx_2 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_I33);
  __pyx_v_I33 = __pyx_2;
  __pyx_2 = 0;

  /* "/home/zefiris/pyode/src/mass.pyx":308 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_I12);
  __pyx_v_I12 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/zefiris/pyode/src/mass.pyx":309 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[2])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
  __pyx_2 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_I13);
  __pyx_v_I13 = __pyx_2;
  __pyx_2 = 0;

  /* "/home/zefiris/pyode/src/mass.pyx":310 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.I[6])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_I23);
  __pyx_v_I23 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/zefiris/pyode/src/mass.pyx":311 */
  __pyx_1 = PyTuple_New(10); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; goto __pyx_L1;}
  Py_INCREF(__pyx_v_m);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_m);
  Py_INCREF(__pyx_v_sc0);
  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_sc0);
  Py_INCREF(__pyx_v_sc1);
  PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_sc1);
  Py_INCREF(__pyx_v_sc2);
  PyTuple_SET_ITEM(__pyx_1, 3, __pyx_v_sc2);
  Py_INCREF(__pyx_v_I11);
  PyTuple_SET_ITEM(__pyx_1, 4, __pyx_v_I11);
  Py_INCREF(__pyx_v_I22);
  PyTuple_SET_ITEM(__pyx_1, 5, __pyx_v_I22);
  Py_INCREF(__pyx_v_I33);
  PyTuple_SET_ITEM(__pyx_1, 6, __pyx_v_I33);
  Py_INCREF(__pyx_v_I12);
  PyTuple_SET_ITEM(__pyx_1, 7, __pyx_v_I12);
  Py_INCREF(__pyx_v_I13);
  PyTuple_SET_ITEM(__pyx_1, 8, __pyx_v_I13);
  Py_INCREF(__pyx_v_I23);
  PyTuple_SET_ITEM(__pyx_1, 9, __pyx_v_I23);
  __pyx_2 = PyNumber_Remainder(__pyx_k78p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.Mass.__str__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_m);
  Py_DECREF(__pyx_v_sc0);
  Py_DECREF(__pyx_v_sc1);
  Py_DECREF(__pyx_v_sc2);
  Py_DECREF(__pyx_v_I11);
  Py_DECREF(__pyx_v_I22);
  Py_DECREF(__pyx_v_I33);
  Py_DECREF(__pyx_v_I12);
  Py_DECREF(__pyx_v_I13);
  Py_DECREF(__pyx_v_I23);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_3ode_7Contact___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_7Contact___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/contact.pyx":42 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ContactBounce); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.mode = __pyx_2;

  /* "/home/zefiris/pyode/src/contact.pyx":43 */
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.mu = dInfinity;

  /* "/home/zefiris/pyode/src/contact.pyx":45 */
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.bounce = 0.1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Contact.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_getMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_getMode[] = "getMode() -> flags\n\n        Return the contact flags.\n        ";
static PyObject *__pyx_f_3ode_7Contact_getMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/contact.pyx":53 */
  __pyx_1 = PyInt_FromLong(((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.mode); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 53; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Contact.getMode");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_setMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_setMode[] = "setMode(flags)\n\n        Set the contact flags. The argument m is a combination of the\n        ContactXyz flags (ContactMu2, ContactBounce, ...).\n \n        @param flags: Contact flags\n        @type flags: int\n        ";
static PyObject *__pyx_f_3ode_7Contact_setMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_flags = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"flags",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_flags)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_flags);

  /* "/home/zefiris/pyode/src/contact.pyx":65 */
  __pyx_1 = PyInt_AsLong(__pyx_v_flags); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.mode = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Contact.setMode");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_flags);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_getMu(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_getMu[] = "getMu() -> float\n\n        Return the Coulomb friction coefficient. \n        ";
static PyObject *__pyx_f_3ode_7Contact_getMu(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/contact.pyx":73 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.mu); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Contact.getMu");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_setMu(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_setMu[] = "setMu(mu)\n\n        Set the Coulomb friction coefficient.\n\n        @param mu: Coulomb friction coefficient (0..Infinity)\n        @type mu: float\n        ";
static PyObject *__pyx_f_3ode_7Contact_setMu(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mu = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"mu",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_mu)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_mu);

  /* "/home/zefiris/pyode/src/contact.pyx":84 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_mu); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.mu = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Contact.setMu");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_mu);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_getMu2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_getMu2[] = "getMu2() -> float\n\n        Return the optional Coulomb friction coefficient for direction 2.\n        ";
static PyObject *__pyx_f_3ode_7Contact_getMu2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/contact.pyx":92 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.mu2); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Contact.getMu2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_setMu2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_setMu2[] = "setMu2(mu)\n\n        Set the optional Coulomb friction coefficient for direction 2.\n\n        @param mu: Coulomb friction coefficient (0..Infinity)\n        @type mu: float\n        ";
static PyObject *__pyx_f_3ode_7Contact_setMu2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mu = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"mu",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_mu)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_mu);

  /* "/home/zefiris/pyode/src/contact.pyx":103 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_mu); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.mu2 = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Contact.setMu2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_mu);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_getBounce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_getBounce[] = "getBounce() -> float\n\n        Return the restitution parameter.\n        ";
static PyObject *__pyx_f_3ode_7Contact_getBounce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/contact.pyx":111 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.bounce); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Contact.getBounce");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_setBounce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_setBounce[] = "setBounce(b)\n\n        @param b: Restitution parameter (0..1)\n        @type b: float\n        ";
static PyObject *__pyx_f_3ode_7Contact_setBounce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_b = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"b",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_b)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_b);

  /* "/home/zefiris/pyode/src/contact.pyx":120 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_b); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.bounce = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Contact.setBounce");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_b);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_getBounceVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_getBounceVel[] = "getBounceVel() -> float\n\n        Return the minimum incoming velocity necessary for bounce.\n        ";
static PyObject *__pyx_f_3ode_7Contact_getBounceVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/contact.pyx":128 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.bounce_vel); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 128; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Contact.getBounceVel");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_setBounceVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_setBounceVel[] = "setBounceVel(bv)\n\n        Set the minimum incoming velocity necessary for bounce. Incoming\n        velocities below this will effectively have a bounce parameter of 0.\n\n        @param bv: Velocity\n        @type bv: float\n        ";
static PyObject *__pyx_f_3ode_7Contact_setBounceVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bv = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"bv",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_bv)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_bv);

  /* "/home/zefiris/pyode/src/contact.pyx":140 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_bv); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.bounce_vel = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Contact.setBounceVel");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_bv);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_getSoftERP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_getSoftERP[] = "getSoftERP() -> float\n\n        Return the contact normal \"softness\" parameter.\n        ";
static PyObject *__pyx_f_3ode_7Contact_getSoftERP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/contact.pyx":148 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.soft_erp); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Contact.getSoftERP");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_setSoftERP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_setSoftERP[] = "setSoftERP(erp)\n\n        Set the contact normal \"softness\" parameter.\n\n        @param erp: Softness parameter\n        @type erp: float\n        ";
static PyObject *__pyx_f_3ode_7Contact_setSoftERP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_erp = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"erp",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_erp)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_erp);

  /* "/home/zefiris/pyode/src/contact.pyx":159 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_erp); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.soft_erp = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Contact.setSoftERP");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_erp);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_getSoftCFM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_getSoftCFM[] = "getSoftCFM() -> float\n\n        Return the contact normal \"softness\" parameter.\n        ";
static PyObject *__pyx_f_3ode_7Contact_getSoftCFM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/contact.pyx":167 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.soft_cfm); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 167; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Contact.getSoftCFM");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_setSoftCFM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_setSoftCFM[] = "setSoftCFM(cfm)\n\n        Set the contact normal \"softness\" parameter.\n\n        @param cfm: Softness parameter\n        @type cfm: float\n        ";
static PyObject *__pyx_f_3ode_7Contact_setSoftCFM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cfm = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"cfm",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_cfm)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_cfm);

  /* "/home/zefiris/pyode/src/contact.pyx":178 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_cfm); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.soft_cfm = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Contact.setSoftCFM");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_cfm);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_getMotion1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_getMotion1[] = "getMotion1() -> float\n\n        Get the surface velocity in friction direction 1.\n        ";
static PyObject *__pyx_f_3ode_7Contact_getMotion1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/contact.pyx":186 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.motion1); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Contact.getMotion1");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_setMotion1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_setMotion1[] = "setMotion1(m)\n\n        Set the surface velocity in friction direction 1.\n\n        @param m: Surface velocity\n        @type m: float\n        ";
static PyObject *__pyx_f_3ode_7Contact_setMotion1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_m = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"m",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_m)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_m);

  /* "/home/zefiris/pyode/src/contact.pyx":197 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_m); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 197; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.motion1 = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Contact.setMotion1");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_m);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_getMotion2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_getMotion2[] = "getMotion2() -> float\n\n        Get the surface velocity in friction direction 2.\n        ";
static PyObject *__pyx_f_3ode_7Contact_getMotion2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/contact.pyx":205 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.motion2); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Contact.getMotion2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_setMotion2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_setMotion2[] = "setMotion2(m)\n\n        Set the surface velocity in friction direction 2.\n\n        @param m: Surface velocity\n        @type m: float\n        ";
static PyObject *__pyx_f_3ode_7Contact_setMotion2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_m = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"m",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_m)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_m);

  /* "/home/zefiris/pyode/src/contact.pyx":216 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_m); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.motion2 = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Contact.setMotion2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_m);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_getSlip1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_getSlip1[] = "getSlip1() -> float\n\n        Get the coefficient of force-dependent-slip (FDS) for friction\n        direction 1.\n        ";
static PyObject *__pyx_f_3ode_7Contact_getSlip1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/contact.pyx":225 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.slip1); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 225; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Contact.getSlip1");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_setSlip1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_setSlip1[] = "setSlip1(s)\n\n        Set the coefficient of force-dependent-slip (FDS) for friction\n        direction 1.\n\n        @param s: FDS coefficient\n        @type s: float\n        ";
static PyObject *__pyx_f_3ode_7Contact_setSlip1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_s = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"s",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_s)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_s);

  /* "/home/zefiris/pyode/src/contact.pyx":237 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_s); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.slip1 = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Contact.setSlip1");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_s);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_getSlip2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_getSlip2[] = "getSlip2() -> float\n\n        Get the coefficient of force-dependent-slip (FDS) for friction\n        direction 2.\n        ";
static PyObject *__pyx_f_3ode_7Contact_getSlip2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/contact.pyx":246 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.slip2); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 246; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Contact.getSlip2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_setSlip2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_setSlip2[] = "setSlip2(s)\n\n        Set the coefficient of force-dependent-slip (FDS) for friction\n        direction 1.\n\n        @param s: FDS coefficient\n        @type s: float\n        ";
static PyObject *__pyx_f_3ode_7Contact_setSlip2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_s = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"s",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_s)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_s);

  /* "/home/zefiris/pyode/src/contact.pyx":258 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_s); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 258; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.slip2 = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Contact.setSlip2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_s);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_getFDir1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_getFDir1[] = "getFDir1() -> (x, y, z)\n\n        Get the \"first friction direction\" vector that defines a direction\n        along which frictional force is applied.\n        ";
static PyObject *__pyx_f_3ode_7Contact_getFDir1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/contact.pyx":267 */
  __pyx_1 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.fdir1[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.fdir1[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.fdir1[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Contact.getFDir1");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_setFDir1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_setFDir1[] = "setFDir1(fdir)\n\n        Set the \"first friction direction\" vector that defines a direction\n        along which frictional force is applied. It must be of unit length\n        and perpendicular to the contact normal (so it is typically\n        tangential to the contact surface).\n\n        @param fdir: Friction direction\n        @type fdir: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_7Contact_setFDir1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fdir = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  static char *__pyx_argnames[] = {"fdir",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_fdir)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_fdir);

  /* "/home/zefiris/pyode/src/contact.pyx":281 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_fdir, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.fdir1[0]) = __pyx_3;

  /* "/home/zefiris/pyode/src/contact.pyx":282 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_fdir, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.fdir1[1]) = __pyx_3;

  /* "/home/zefiris/pyode/src/contact.pyx":283 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_fdir, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.fdir1[2]) = __pyx_3;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Contact.setFDir1");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_fdir);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7Contact_getContactGeomParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_getContactGeomParams[] = "getContactGeomParams() -> (pos, normal, depth, geom1, geom2)\n\n        Get the ContactGeom structure of the contact.\n\n        The return value is a tuple (pos, normal, depth, geom1, geom2)\n        where pos and normal are 3-tuples of floats and depth is a single\n        float. geom1 and geom2 are the Geom objects of the geoms in contact.\n        ";
static PyObject *__pyx_f_3ode_7Contact_getContactGeomParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_id1;
  long __pyx_v_id2;
  PyObject *__pyx_v_pos;
  PyObject *__pyx_v_normal;
  PyObject *__pyx_v_depth;
  PyObject *__pyx_v_g1;
  PyObject *__pyx_v_g2;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);
  __pyx_v_pos = Py_None; Py_INCREF(Py_None);
  __pyx_v_normal = Py_None; Py_INCREF(Py_None);
  __pyx_v_depth = Py_None; Py_INCREF(Py_None);
  __pyx_v_g1 = Py_None; Py_INCREF(Py_None);
  __pyx_v_g2 = Py_None; Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/contact.pyx":298 */
  __pyx_1 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.pos[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 298; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.pos[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 298; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.pos[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 298; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 298; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  Py_DECREF(__pyx_v_pos);
  __pyx_v_pos = __pyx_4;
  __pyx_4 = 0;

  /* "/home/zefiris/pyode/src/contact.pyx":299 */
  __pyx_1 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.normal[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 299; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.normal[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 299; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.normal[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 299; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 299; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  Py_DECREF(__pyx_v_normal);
  __pyx_v_normal = __pyx_4;
  __pyx_4 = 0;

  /* "/home/zefiris/pyode/src/contact.pyx":300 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.depth); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 300; goto __pyx_L1;}
  Py_DECREF(__pyx_v_depth);
  __pyx_v_depth = __pyx_1;
  __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/contact.pyx":302 */
  __pyx_v_id1 = ((long )((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.g1);

  /* "/home/zefiris/pyode/src/contact.pyx":303 */
  __pyx_v_id2 = ((long )((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.g2);

  /* "/home/zefiris/pyode/src/contact.pyx":304 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 304; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(__pyx_v_id1); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 304; goto __pyx_L1;}
  __pyx_4 = PyObject_GetItem(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 304; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_g1);
  __pyx_v_g1 = __pyx_4;
  __pyx_4 = 0;

  /* "/home/zefiris/pyode/src/contact.pyx":305 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 305; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(__pyx_v_id2); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 305; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 305; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_g2);
  __pyx_v_g2 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/zefiris/pyode/src/contact.pyx":306 */
  __pyx_4 = PyTuple_New(5); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_INCREF(__pyx_v_pos);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_pos);
  Py_INCREF(__pyx_v_normal);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_normal);
  Py_INCREF(__pyx_v_depth);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_v_depth);
  Py_INCREF(__pyx_v_g1);
  PyTuple_SET_ITEM(__pyx_4, 3, __pyx_v_g1);
  Py_INCREF(__pyx_v_g2);
  PyTuple_SET_ITEM(__pyx_4, 4, __pyx_v_g2);
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Contact.getContactGeomParams");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_pos);
  Py_DECREF(__pyx_v_normal);
  Py_DECREF(__pyx_v_depth);
  Py_DECREF(__pyx_v_g1);
  Py_DECREF(__pyx_v_g2);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n__id;

static PyObject *__pyx_f_3ode_7Contact_setContactGeomParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_setContactGeomParams[] = "setContactGeomParams(pos, normal, depth, geom1=None, geom2=None)\n        \n        Set the ContactGeom structure of the contact.\n\n        @param pos:  Contact position, in global coordinates\n        @type pos: 3-sequence of floats\n        @param normal: Unit length normal vector\n        @type normal: 3-sequence of floats\n        @param depth: Depth to which the two bodies inter-penetrate\n        @type depth: float\n        @param geom1: Geometry object 1 that collided\n        @type geom1: Geom\n        @param geom2: Geometry object 2 that collided\n        @type geom2: Geom\n        ";
static PyObject *__pyx_f_3ode_7Contact_setContactGeomParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_v_normal = 0;
  PyObject *__pyx_v_depth = 0;
  PyObject *__pyx_v_g1 = 0;
  PyObject *__pyx_v_g2 = 0;
  long __pyx_v_id;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  int __pyx_4;
  long __pyx_5;
  static char *__pyx_argnames[] = {"pos","normal","depth","g1","g2",0};
  __pyx_v_g1 = __pyx_k2;
  __pyx_v_g2 = __pyx_k3;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|OO", __pyx_argnames, &__pyx_v_pos, &__pyx_v_normal, &__pyx_v_depth, &__pyx_v_g1, &__pyx_v_g2)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_pos);
  Py_INCREF(__pyx_v_normal);
  Py_INCREF(__pyx_v_depth);
  Py_INCREF(__pyx_v_g1);
  Py_INCREF(__pyx_v_g2);

  /* "/home/zefiris/pyode/src/contact.pyx":328 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 328; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 328; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 328; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.pos[0]) = __pyx_3;

  /* "/home/zefiris/pyode/src/contact.pyx":329 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 329; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 329; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 329; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.pos[1]) = __pyx_3;

  /* "/home/zefiris/pyode/src/contact.pyx":330 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 330; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 330; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 330; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.pos[2]) = __pyx_3;

  /* "/home/zefiris/pyode/src/contact.pyx":331 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 331; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 331; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 331; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.normal[0]) = __pyx_3;

  /* "/home/zefiris/pyode/src/contact.pyx":332 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 332; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 332; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 332; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.normal[1]) = __pyx_3;

  /* "/home/zefiris/pyode/src/contact.pyx":333 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.normal[2]) = __pyx_3;

  /* "/home/zefiris/pyode/src/contact.pyx":334 */
  __pyx_3 = PyFloat_AsDouble(__pyx_v_depth); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 334; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.depth = __pyx_3;

  /* "/home/zefiris/pyode/src/contact.pyx":335 */
  if (PyObject_Cmp(__pyx_v_g1, Py_None, &__pyx_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; goto __pyx_L1;}
  __pyx_4 = __pyx_4 != 0;
  if (__pyx_4) {

    /* "/home/zefiris/pyode/src/contact.pyx":336 */
    __pyx_1 = PyObject_GetAttr(__pyx_v_g1, __pyx_n__id); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 336; goto __pyx_L1;}
    __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 336; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_5 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 336; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_v_id = __pyx_5;

    /* "/home/zefiris/pyode/src/contact.pyx":337 */
    ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.g1 = ((struct dxGeom (*))__pyx_v_id);
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/zefiris/pyode/src/contact.pyx":339 */
    ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.g1 = ((struct dxGeom (*))0);
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/contact.pyx":341 */
  if (PyObject_Cmp(__pyx_v_g2, Py_None, &__pyx_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 341; goto __pyx_L1;}
  __pyx_4 = __pyx_4 != 0;
  if (__pyx_4) {

    /* "/home/zefiris/pyode/src/contact.pyx":342 */
    __pyx_1 = PyObject_GetAttr(__pyx_v_g2, __pyx_n__id); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; goto __pyx_L1;}
    __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_5 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_v_id = __pyx_5;

    /* "/home/zefiris/pyode/src/contact.pyx":343 */
    ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.g2 = ((struct dxGeom (*))__pyx_v_id);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/zefiris/pyode/src/contact.pyx":345 */
    ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.g2 = ((struct dxGeom (*))0);
  }
  __pyx_L3:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Contact.setContactGeomParams");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_pos);
  Py_DECREF(__pyx_v_normal);
  Py_DECREF(__pyx_v_depth);
  Py_DECREF(__pyx_v_g1);
  Py_DECREF(__pyx_v_g2);
  return __pyx_r;
}

static int __pyx_f_3ode_5World___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_5World___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/world.pyx":37 */
  ((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid = dWorldCreate();

  __pyx_r = 0;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static void __pyx_f_3ode_5World___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_f_3ode_5World___dealloc__(PyObject *__pyx_v_self) {
  int __pyx_1;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/world.pyx":40 */
  __pyx_1 = (((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid != NULL);
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/world.pyx":41 */
    dWorldDestroy(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid);
    goto __pyx_L2;
  }
  __pyx_L2:;

  Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_f_3ode_5World_setGravity(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_setGravity[] = "setGravity(gravity)\n\n        Set the world\'s global gravity vector.\n\n        @param gravity: Gravity vector\n        @type gravity: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_5World_setGravity(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_gravity = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"gravity",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_gravity)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_gravity);

  /* "/home/zefiris/pyode/src/world.pyx":52 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_gravity, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_gravity, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_gravity, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dWorldSetGravity(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.World.setGravity");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_gravity);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_getGravity(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_getGravity[] = "getGravity() -> 3-tuple\n\n        Return the world\'s global gravity vector as a 3-tuple of floats.\n        ";
static PyObject *__pyx_f_3ode_5World_getGravity(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_g;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/world.pyx":61 */
  dWorldGetGravity(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_v_g);

  /* "/home/zefiris/pyode/src/world.pyx":62 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_g[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 62; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_g[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 62; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_g[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 62; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 62; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.World.getGravity");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_setERP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_setERP[] = "setERP(erp)\n\n        Set the global ERP value, that controls how much error\n        correction is performed in each time step. Typical values are\n        in the range 0.1-0.8. The default is 0.2.\n\n        @param erp: Global ERP value\n        @type erp: float\n        ";
static PyObject *__pyx_f_3ode_5World_setERP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_erp = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"erp",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_erp)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_erp);

  /* "/home/zefiris/pyode/src/world.pyx":75 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_erp); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 75; goto __pyx_L1;}
  dWorldSetERP(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.World.setERP");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_erp);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_getERP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_getERP[] = "getERP() -> float\n\n        Get the global ERP value, that controls how much error\n        correction is performed in each time step. Typical values are\n        in the range 0.1-0.8. The default is 0.2.\n        ";
static PyObject *__pyx_f_3ode_5World_getERP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/world.pyx":85 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetERP(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.World.getERP");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_setCFM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_setCFM[] = "setCFM(cfm)\n\n        Set the global CFM (constraint force mixing) value. Typical\n        values are in the range 10E-9 - 1. The default is 10E-5 if\n        single precision is being used, or 10E-10 if double precision\n        is being used.\n\n        @param cfm: Constraint force mixing value\n        @type cfm: float\n        ";
static PyObject *__pyx_f_3ode_5World_setCFM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cfm = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"cfm",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_cfm)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_cfm);

  /* "/home/zefiris/pyode/src/world.pyx":99 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_cfm); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; goto __pyx_L1;}
  dWorldSetCFM(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.World.setCFM");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_cfm);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_getCFM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_getCFM[] = "getCFM() -> float\n\n        Get the global CFM (constraint force mixing) value. Typical\n        values are in the range 10E-9 - 1. The default is 10E-5 if\n        single precision is being used, or 10E-10 if double precision\n        is being used.\n        ";
static PyObject *__pyx_f_3ode_5World_getCFM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/world.pyx":110 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetCFM(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 110; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.World.getCFM");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_step[] = "step(stepsize)\n\n        Step the world. This uses a \"big matrix\" method that takes\n        time on the order of O(m3) and memory on the order of O(m2), where m\n        is the total number of constraint rows.\n\n        For large systems this will use a lot of memory and can be\n        very slow, but this is currently the most accurate method.\n\n        @param stepsize: Time step\n        @type stepsize: float\n        ";
static PyObject *__pyx_f_3ode_5World_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_stepsize = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"stepsize",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_stepsize)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_stepsize);

  /* "/home/zefiris/pyode/src/world.pyx":127 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_stepsize); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; goto __pyx_L1;}
  dWorldStep(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.World.step");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_stepsize);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_quickStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_quickStep[] = "quickStep(stepsize)\n        \n        Step the world. This uses an iterative method that takes time\n        on the order of O(m*N) and memory on the order of O(m), where m is\n        the total number of constraint rows and N is the number of\n        iterations.\n\n        For large systems this is a lot faster than dWorldStep, but it\n        is less accurate.\n\n        @param stepsize: Time step\n        @type stepsize: float        \n        ";
static PyObject *__pyx_f_3ode_5World_quickStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_stepsize = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"stepsize",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_stepsize)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_stepsize);

  /* "/home/zefiris/pyode/src/world.pyx":144 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_stepsize); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; goto __pyx_L1;}
  dWorldQuickStep(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.World.quickStep");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_stepsize);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_setQuickStepNumIterations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_setQuickStepNumIterations[] = "setQuickStepNumIterations(num)\n        \n        Set the number of iterations that the QuickStep method\n        performs per step. More iterations will give a more accurate\n        solution, but will take longer to compute. The default is 20\n        iterations.\n\n        @param num: Number of iterations\n        @type num: int\n        ";
static PyObject *__pyx_f_3ode_5World_setQuickStepNumIterations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_num = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"num",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_num)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_num);

  /* "/home/zefiris/pyode/src/world.pyx":159 */
  __pyx_1 = PyInt_AsLong(__pyx_v_num); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; goto __pyx_L1;}
  dWorldSetQuickStepNumIterations(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.World.setQuickStepNumIterations");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_num);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_getQuickStepNumIterations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_getQuickStepNumIterations[] = "getQuickStepNumIterations() -> int\n        \n        Get the number of iterations that the QuickStep method\n        performs per step. More iterations will give a more accurate\n        solution, but will take longer to compute. The default is 20\n        iterations.\n        ";
static PyObject *__pyx_f_3ode_5World_getQuickStepNumIterations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/world.pyx":170 */
  __pyx_1 = PyInt_FromLong(dWorldGetQuickStepNumIterations(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.World.getQuickStepNumIterations");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_setContactMaxCorrectingVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_setContactMaxCorrectingVel[] = "setContactMaxCorrectingVel(vel)\n\n        Set the maximum correcting velocity that contacts are allowed\n        to generate. The default value is infinity (i.e. no\n        limit). Reducing this value can help prevent \"popping\" of\n        deeply embedded objects.\n\n        @param vel: Maximum correcting velocity\n        @type vel: float\n        ";
static PyObject *__pyx_f_3ode_5World_setContactMaxCorrectingVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vel = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"vel",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_vel)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_vel);

  /* "/home/zefiris/pyode/src/world.pyx":184 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_vel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 184; goto __pyx_L1;}
  dWorldSetContactMaxCorrectingVel(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.World.setContactMaxCorrectingVel");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_vel);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_getContactMaxCorrectingVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_getContactMaxCorrectingVel[] = "getContactMaxCorrectingVel() -> float\n\n        Get the maximum correcting velocity that contacts are allowed\n        to generate. The default value is infinity (i.e. no\n        limit). Reducing this value can help prevent \"popping\" of\n        deeply embedded objects.        \n        ";
static PyObject *__pyx_f_3ode_5World_getContactMaxCorrectingVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/world.pyx":195 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetContactMaxCorrectingVel(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 195; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.World.getContactMaxCorrectingVel");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_setContactSurfaceLayer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_setContactSurfaceLayer[] = "setContactSurfaceLayer(depth)\n\n        Set the depth of the surface layer around all geometry\n        objects. Contacts are allowed to sink into the surface layer\n        up to the given depth before coming to rest. The default value\n        is zero. Increasing this to some small value (e.g. 0.001) can\n        help prevent jittering problems due to contacts being\n        repeatedly made and broken.\n\n        @param depth: Surface layer depth\n        @type depth: float\n        ";
static PyObject *__pyx_f_3ode_5World_setContactSurfaceLayer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_depth = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"depth",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_depth)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_depth);

  /* "/home/zefiris/pyode/src/world.pyx":211 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_depth); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 211; goto __pyx_L1;}
  dWorldSetContactSurfaceLayer(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.World.setContactSurfaceLayer");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_depth);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_getContactSurfaceLayer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_getContactSurfaceLayer[] = "getContactSurfaceLayer()\n\n        Get the depth of the surface layer around all geometry\n        objects. Contacts are allowed to sink into the surface layer\n        up to the given depth before coming to rest. The default value\n        is zero. Increasing this to some small value (e.g. 0.001) can\n        help prevent jittering problems due to contacts being\n        repeatedly made and broken.\n        ";
static PyObject *__pyx_f_3ode_5World_getContactSurfaceLayer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/world.pyx":224 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetContactSurfaceLayer(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.World.getContactSurfaceLayer");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_setAutoDisableFlag(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_setAutoDisableFlag[] = "setAutoDisableFlag(flag)\n        \n        Set the default auto-disable flag for newly created bodies.\n\n        @param flag: True = Do auto disable\n        @type flag: bool\n        ";
static PyObject *__pyx_f_3ode_5World_setAutoDisableFlag(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_flag = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"flag",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_flag)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_flag);

  /* "/home/zefiris/pyode/src/world.pyx":235 */
  __pyx_1 = PyInt_AsLong(__pyx_v_flag); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 235; goto __pyx_L1;}
  dWorldSetAutoDisableFlag(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.World.setAutoDisableFlag");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_flag);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_getAutoDisableFlag(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_getAutoDisableFlag[] = "getAutoDisableFlag() -> bool\n        \n        Get the default auto-disable flag for newly created bodies.\n        ";
static PyObject *__pyx_f_3ode_5World_getAutoDisableFlag(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/world.pyx":243 */
  __pyx_1 = PyInt_FromLong(dWorldGetAutoDisableFlag(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 243; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.World.getAutoDisableFlag");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_setAutoDisableLinearThreshold(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_setAutoDisableLinearThreshold[] = "setAutoDisableLinearThreshold(threshold)\n        \n        Set the default auto-disable linear threshold for newly created\n        bodies.\n\n        @param threshold: Linear threshold\n        @type threshold: float\n        ";
static PyObject *__pyx_f_3ode_5World_setAutoDisableLinearThreshold(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_threshold = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"threshold",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_threshold)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_threshold);

  /* "/home/zefiris/pyode/src/world.pyx":256 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_threshold); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 256; goto __pyx_L1;}
  dWorldSetAutoDisableLinearThreshold(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.World.setAutoDisableLinearThreshold");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_threshold);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_getAutoDisableLinearThreshold(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_getAutoDisableLinearThreshold[] = "getAutoDisableLinearThreshold() -> float\n        \n        Get the default auto-disable linear threshold for newly created\n        bodies.\n        ";
static PyObject *__pyx_f_3ode_5World_getAutoDisableLinearThreshold(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/world.pyx":265 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetAutoDisableLinearThreshold(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 265; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.World.getAutoDisableLinearThreshold");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_setAutoDisableAngularThreshold(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_setAutoDisableAngularThreshold[] = "setAutoDisableAngularThreshold(threshold)\n        \n        Set the default auto-disable angular threshold for newly created\n        bodies.\n\n        @param threshold: Angular threshold\n        @type threshold: float\n        ";
static PyObject *__pyx_f_3ode_5World_setAutoDisableAngularThreshold(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_threshold = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"threshold",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_threshold)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_threshold);

  /* "/home/zefiris/pyode/src/world.pyx":277 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_threshold); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; goto __pyx_L1;}
  dWorldSetAutoDisableAngularThreshold(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.World.setAutoDisableAngularThreshold");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_threshold);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_getAutoDisableAngularThreshold(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_getAutoDisableAngularThreshold[] = "getAutoDisableAngularThreshold() -> float\n        \n        Get the default auto-disable angular threshold for newly created\n        bodies.\n        ";
static PyObject *__pyx_f_3ode_5World_getAutoDisableAngularThreshold(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/world.pyx":286 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetAutoDisableAngularThreshold(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 286; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.World.getAutoDisableAngularThreshold");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_setAutoDisableSteps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_setAutoDisableSteps[] = "setAutoDisableSteps(steps)\n        \n        Set the default auto-disable steps for newly created bodies.\n\n        @param steps: Auto disable steps\n        @type steps: int\n        ";
static PyObject *__pyx_f_3ode_5World_setAutoDisableSteps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_steps = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"steps",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_steps)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_steps);

  /* "/home/zefiris/pyode/src/world.pyx":297 */
  __pyx_1 = PyInt_AsLong(__pyx_v_steps); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 297; goto __pyx_L1;}
  dWorldSetAutoDisableSteps(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.World.setAutoDisableSteps");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_steps);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_getAutoDisableSteps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_getAutoDisableSteps[] = "getAutoDisableSteps() -> int\n        \n        Get the default auto-disable steps for newly created bodies.\n        ";
static PyObject *__pyx_f_3ode_5World_getAutoDisableSteps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/world.pyx":305 */
  __pyx_1 = PyInt_FromLong(dWorldGetAutoDisableSteps(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 305; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.World.getAutoDisableSteps");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_setAutoDisableTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_setAutoDisableTime[] = "setAutoDisableTime(time)\n        \n        Set the default auto-disable time for newly created bodies.\n\n        @param time: Auto disable time\n        @type time: float\n        ";
static PyObject *__pyx_f_3ode_5World_setAutoDisableTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_time = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"time",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_time)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_time);

  /* "/home/zefiris/pyode/src/world.pyx":316 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_time); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 316; goto __pyx_L1;}
  dWorldSetAutoDisableTime(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.World.setAutoDisableTime");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_time);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_getAutoDisableTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_getAutoDisableTime[] = "getAutoDisableTime() -> float\n        \n        Get the default auto-disable time for newly created bodies.\n        ";
static PyObject *__pyx_f_3ode_5World_getAutoDisableTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/world.pyx":324 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetAutoDisableTime(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 324; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.World.getAutoDisableTime");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5World_impulseToForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5World_impulseToForce[] = "impulseToForce(stepsize, impulse) -> 3-tuple\n\n        If you want to apply a linear or angular impulse to a rigid\n        body, instead of a force or a torque, then you can use this\n        function to convert the desired impulse into a force/torque\n        vector before calling the dBodyAdd... function.\n\n        @param stepsize: Time step\n        @param impulse: Impulse vector\n        @type stepsize: float\n        @type impulse: 3-tuple of floats\n        ";
static PyObject *__pyx_f_3ode_5World_impulseToForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_stepsize = 0;
  PyObject *__pyx_v_impulse = 0;
  dVector3 __pyx_v_force;
  PyObject *__pyx_r;
  dReal __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  dReal __pyx_4;
  dReal __pyx_5;
  dReal __pyx_6;
  PyObject *__pyx_7 = 0;
  PyObject *__pyx_8 = 0;
  static char *__pyx_argnames[] = {"stepsize","impulse",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_stepsize, &__pyx_v_impulse)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_stepsize);
  Py_INCREF(__pyx_v_impulse);

  /* "/home/zefiris/pyode/src/world.pyx":341 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_stepsize); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_impulse, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_impulse, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyInt_FromLong(2); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_impulse, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  dWorldImpulseToForce(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1,__pyx_4,__pyx_5,__pyx_6,__pyx_v_force);

  /* "/home/zefiris/pyode/src/world.pyx":342 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_force[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 342; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_force[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 342; goto __pyx_L1;}
  __pyx_7 = PyFloat_FromDouble((__pyx_v_force[2])); if (!__pyx_7) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 342; goto __pyx_L1;}
  __pyx_8 = PyTuple_New(3); if (!__pyx_8) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 342; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_8, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_8, 1, __pyx_3);
  PyTuple_SET_ITEM(__pyx_8, 2, __pyx_7);
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_7 = 0;
  __pyx_r = __pyx_8;
  __pyx_8 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_7);
  Py_XDECREF(__pyx_8);
  __Pyx_AddTraceback("ode.World.impulseToForce");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_stepsize);
  Py_DECREF(__pyx_v_impulse);
  return __pyx_r;
}

static int __pyx_f_3ode_4Body___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_4Body___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  int __pyx_r;
  static char *__pyx_argnames[] = {"world",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_world)) return -1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 46; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/body.pyx":47 */
  ((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid = dBodyCreate(__pyx_v_world->wid);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Body.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  return __pyx_r;
}

static int __pyx_f_3ode_4Body___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body___init__[] = "Constructor.\n\n        @param world: The world in which the body should be created.\n        @type world: World\n        ";
static int __pyx_f_3ode_4Body___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {"world",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_world)) return -1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/body.pyx":55 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->world);
  ((struct __pyx_obj_3ode_Body *)__pyx_v_self)->world = ((PyObject *)__pyx_v_world);

  /* "/home/zefiris/pyode/src/body.pyx":56 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 56; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->userattribs);
  ((struct __pyx_obj_3ode_Body *)__pyx_v_self)->userattribs = __pyx_1;
  __pyx_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Body.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  return __pyx_r;
}

static void __pyx_f_3ode_4Body___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_f_3ode_4Body___dealloc__(PyObject *__pyx_v_self) {
  int __pyx_1;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":59 */
  __pyx_1 = (((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid != NULL);
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/body.pyx":60 */
    dBodyDestroy(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid);
    goto __pyx_L2;
  }
  __pyx_L2:;

  Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_k79p;

static char (__pyx_k79[]) = "Body object has no attribute '%s'";

static PyObject *__pyx_f_3ode_4Body___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_f_3ode_4Body___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_name);

  /* "/home/zefiris/pyode/src/body.pyx":63 */
  /*try:*/ {

    /* "/home/zefiris/pyode/src/body.pyx":64 */
    __pyx_1 = PyObject_GetItem(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->userattribs, __pyx_v_name); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; goto __pyx_L2;}
    __pyx_r = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L0;
  }
  goto __pyx_L3;
  __pyx_L2:;
  Py_XDECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/body.pyx":65 */
  /*except:*/ {
    __Pyx_AddTraceback("ode.__getattr__");
    __pyx_1 = __Pyx_GetExcValue(); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;

    /* "/home/zefiris/pyode/src/body.pyx":66 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; goto __pyx_L1;}
    __pyx_2 = PyNumber_Remainder(__pyx_k79p, __pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_2, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.__getattr__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_name);
  return __pyx_r;
}

static int __pyx_f_3ode_4Body___setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /*proto*/
static int __pyx_f_3ode_4Body___setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  int __pyx_r;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_name);
  Py_INCREF(__pyx_v_value);

  /* "/home/zefiris/pyode/src/body.pyx":69 */
  if (PyObject_SetItem(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->userattribs, __pyx_v_name, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; goto __pyx_L1;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Body.__setattr__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_name);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}

static PyObject *__pyx_k80p;

static char (__pyx_k80[]) = "Body object has no attribute '%s'";

static int __pyx_f_3ode_4Body___delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static int __pyx_f_3ode_4Body___delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_name);

  /* "/home/zefiris/pyode/src/body.pyx":72 */
  /*try:*/ {

    /* "/home/zefiris/pyode/src/body.pyx":73 */
    if (PyObject_DelItem(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->userattribs, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; goto __pyx_L2;}
  }
  goto __pyx_L3;
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/body.pyx":74 */
  /*except:*/ {
    __Pyx_AddTraceback("ode.__delattr__");
    __pyx_1 = __Pyx_GetExcValue(); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;

    /* "/home/zefiris/pyode/src/body.pyx":75 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; goto __pyx_L1;}
    __pyx_2 = PyNumber_Remainder(__pyx_k80p, __pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_2, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.__delattr__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_name);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_setPosition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_setPosition[] = "setPosition(pos)\n\n        Set the position of the body.\n\n        @param pos: The new position\n        @type pos: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_setPosition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"pos",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pos)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_pos);

  /* "/home/zefiris/pyode/src/body.pyx":86 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodySetPosition(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.setPosition");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_pos);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getPosition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getPosition[] = "getPosition() -> 3-tuple\n\n        Return the current position of the body.\n        ";
static PyObject *__pyx_f_3ode_4Body_getPosition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dReal (*__pyx_v_p);
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":96 */
  __pyx_v_p = ((dReal (*))dBodyGetPosition(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid));

  /* "/home/zefiris/pyode/src/body.pyx":97 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Body.getPosition");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_setRotation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_setRotation[] = "setRotation(R)\n\n        Set the orientation of the body. The rotation matrix must be\n        given as a sequence of 9 floats which are the elements of the\n        matrix in row-major order.\n\n        @param R: Rotation matrix\n        @type R: 9-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_setRotation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_R = 0;
  dMatrix3 __pyx_v_m;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  static char *__pyx_argnames[] = {"R",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_R)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_R);

  /* "/home/zefiris/pyode/src/body.pyx":111 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[0]) = __pyx_3;

  /* "/home/zefiris/pyode/src/body.pyx":112 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[1]) = __pyx_3;

  /* "/home/zefiris/pyode/src/body.pyx":113 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[2]) = __pyx_3;

  /* "/home/zefiris/pyode/src/body.pyx":114 */
  (__pyx_v_m[3]) = 0;

  /* "/home/zefiris/pyode/src/body.pyx":115 */
  __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[4]) = __pyx_3;

  /* "/home/zefiris/pyode/src/body.pyx":116 */
  __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[5]) = __pyx_3;

  /* "/home/zefiris/pyode/src/body.pyx":117 */
  __pyx_1 = PyInt_FromLong(5); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[6]) = __pyx_3;

  /* "/home/zefiris/pyode/src/body.pyx":118 */
  (__pyx_v_m[7]) = 0;

  /* "/home/zefiris/pyode/src/body.pyx":119 */
  __pyx_1 = PyInt_FromLong(6); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[8]) = __pyx_3;

  /* "/home/zefiris/pyode/src/body.pyx":120 */
  __pyx_1 = PyInt_FromLong(7); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[9]) = __pyx_3;

  /* "/home/zefiris/pyode/src/body.pyx":121 */
  __pyx_1 = PyInt_FromLong(8); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 121; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 121; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 121; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[10]) = __pyx_3;

  /* "/home/zefiris/pyode/src/body.pyx":122 */
  (__pyx_v_m[11]) = 0;

  /* "/home/zefiris/pyode/src/body.pyx":123 */
  dBodySetRotation(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_v_m);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.setRotation");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_R);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getRotation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getRotation[] = "getRotation() -> 9-tuple\n\n        Return the current rotation matrix as a tuple of 9 floats (row-major\n        order).\n        ";
static PyObject *__pyx_f_3ode_4Body_getRotation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dReal (*__pyx_v_m);
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  PyObject *__pyx_8 = 0;
  PyObject *__pyx_9 = 0;
  PyObject *__pyx_10 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":134 */
  __pyx_v_m = ((dReal (*))dBodyGetRotation(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid));

  /* "/home/zefiris/pyode/src/body.pyx":135 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_m[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_m[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_m[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_m[4])); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble((__pyx_v_m[5])); if (!__pyx_5) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_m[6])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; goto __pyx_L1;}
  __pyx_7 = PyFloat_FromDouble((__pyx_v_m[8])); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; goto __pyx_L1;}
  __pyx_8 = PyFloat_FromDouble((__pyx_v_m[9])); if (!__pyx_8) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; goto __pyx_L1;}
  __pyx_9 = PyFloat_FromDouble((__pyx_v_m[10])); if (!__pyx_9) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; goto __pyx_L1;}
  __pyx_10 = PyTuple_New(9); if (!__pyx_10) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_10, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_10, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_10, 2, __pyx_3);
  PyTuple_SET_ITEM(__pyx_10, 3, __pyx_4);
  PyTuple_SET_ITEM(__pyx_10, 4, __pyx_5);
  PyTuple_SET_ITEM(__pyx_10, 5, __pyx_6);
  PyTuple_SET_ITEM(__pyx_10, 6, __pyx_7);
  PyTuple_SET_ITEM(__pyx_10, 7, __pyx_8);
  PyTuple_SET_ITEM(__pyx_10, 8, __pyx_9);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_4 = 0;
  __pyx_5 = 0;
  __pyx_6 = 0;
  __pyx_7 = 0;
  __pyx_8 = 0;
  __pyx_9 = 0;
  __pyx_r = __pyx_10;
  __pyx_10 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  Py_XDECREF(__pyx_8);
  Py_XDECREF(__pyx_9);
  Py_XDECREF(__pyx_10);
  __Pyx_AddTraceback("ode.Body.getRotation");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getQuaternion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getQuaternion[] = "getQuaternion() -> 4-tuple\n\n        Return the current rotation as a quaternion. The return value\n        is a list of 4 floats.\n        ";
static PyObject *__pyx_f_3ode_4Body_getQuaternion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dReal (*__pyx_v_q);
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":145 */
  __pyx_v_q = ((dReal (*))dBodyGetQuaternion(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid));

  /* "/home/zefiris/pyode/src/body.pyx":146 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_q[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_q[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_q[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_q[3])); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(4); if (!__pyx_5) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_5, 2, __pyx_3);
  PyTuple_SET_ITEM(__pyx_5, 3, __pyx_4);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_4 = 0;
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("ode.Body.getQuaternion");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_setQuaternion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_setQuaternion[] = "setQuaternion(q)\n\n        Set the orientation of the body. The quaternion must be given as a\n        sequence of 4 floats.\n\n        @param q: Quaternion\n        @type q: 4-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_setQuaternion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_q = 0;
  dQuaternion __pyx_v_w;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  static char *__pyx_argnames[] = {"q",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_q)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_q);

  /* "/home/zefiris/pyode/src/body.pyx":159 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 159; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_q, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 159; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 159; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_w[0]) = __pyx_3;

  /* "/home/zefiris/pyode/src/body.pyx":160 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 160; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_q, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 160; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 160; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_w[1]) = __pyx_3;

  /* "/home/zefiris/pyode/src/body.pyx":161 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_q, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_w[2]) = __pyx_3;

  /* "/home/zefiris/pyode/src/body.pyx":162 */
  __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 162; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_q, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 162; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 162; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_w[3]) = __pyx_3;

  /* "/home/zefiris/pyode/src/body.pyx":163 */
  dBodySetQuaternion(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_v_w);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.setQuaternion");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_q);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_setLinearVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_setLinearVel[] = "setLinearVel(vel)\n\n        Set the linear velocity of the body.\n\n        @param vel: New velocity\n        @type vel: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_setLinearVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vel = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"vel",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_vel)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_vel);

  /* "/home/zefiris/pyode/src/body.pyx":174 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodySetLinearVel(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.setLinearVel");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_vel);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getLinearVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getLinearVel[] = "getLinearVel() -> 3-tuple\n\n        Get the current linear velocity of the body.\n        ";
static PyObject *__pyx_f_3ode_4Body_getLinearVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dReal (*__pyx_v_p);
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":184 */
  __pyx_v_p = ((dReal (*))dBodyGetLinearVel(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid));

  /* "/home/zefiris/pyode/src/body.pyx":185 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Body.getLinearVel");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_setAngularVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_setAngularVel[] = "setAngularVel(vel)\n\n        Set the angular velocity of the body.\n\n        @param vel: New angular velocity\n        @type vel: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_setAngularVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vel = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"vel",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_vel)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_vel);

  /* "/home/zefiris/pyode/src/body.pyx":196 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodySetAngularVel(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.setAngularVel");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_vel);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getAngularVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getAngularVel[] = "getAngularVel() -> 3-tuple\n\n        Get the current angular velocity of the body.\n        ";
static PyObject *__pyx_f_3ode_4Body_getAngularVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dReal (*__pyx_v_p);
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":206 */
  __pyx_v_p = ((dReal (*))dBodyGetAngularVel(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid));

  /* "/home/zefiris/pyode/src/body.pyx":207 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Body.getAngularVel");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_setMass(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_setMass[] = "setMass(mass)\n\n        Set the mass properties of the body. The argument mass must be\n        an instance of a Mass object.\n\n        @param mass: Mass properties\n        @type mass: Mass\n        ";
static PyObject *__pyx_f_3ode_4Body_setMass(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_Mass *__pyx_v_mass = 0;
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {"mass",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_mass)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_mass);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mass), __pyx_ptype_3ode_Mass, 1, "mass")) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 210; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/body.pyx":219 */
  dBodySetMass(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,(&__pyx_v_mass->_mass));

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Body.setMass");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_mass);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getMass(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getMass[] = "getMass() -> mass\n\n        Return the mass properties as a Mass object.\n        ";
static PyObject *__pyx_f_3ode_4Body_getMass(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_Mass *__pyx_v_m;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);
  __pyx_v_m = ((struct __pyx_obj_3ode_Mass *)Py_None); Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/body.pyx":228 */
  __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_3ode_Mass), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_3ode_Mass)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_m));
  __pyx_v_m = ((struct __pyx_obj_3ode_Mass *)__pyx_1);
  __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/body.pyx":229 */
  dBodyGetMass(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,(&__pyx_v_m->_mass));

  /* "/home/zefiris/pyode/src/body.pyx":230 */
  Py_INCREF(((PyObject *)__pyx_v_m));
  __pyx_r = ((PyObject *)__pyx_v_m);
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Body.getMass");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_m);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_addForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_addForce[] = "addForce(f)\n\n        Add an external force f given in absolute coordinates. The force\n        is applied at the center of mass.\n\n        @param f: Force\n        @type f: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_addForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"f",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_f)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_f);

  /* "/home/zefiris/pyode/src/body.pyx":242 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 242; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 242; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 242; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 242; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 242; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 242; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 242; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 242; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 242; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddForce(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.addForce");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_f);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_addTorque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_addTorque[] = "addTorque(t)\n\n        Add an external torque t given in absolute coordinates.\n\n        @param t: Torque\n        @type t: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_addTorque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_t = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"t",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_t)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_t);

  /* "/home/zefiris/pyode/src/body.pyx":253 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 253; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 253; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 253; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 253; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 253; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 253; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 253; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 253; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 253; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddTorque(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.addTorque");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_t);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_addRelForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_addRelForce[] = "addRelForce(f)\n\n        Add an external force f given in relative coordinates\n        (relative to the body\'s own frame of reference). The force\n        is applied at the center of mass.\n\n        @param f: Force\n        @type f: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_addRelForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"f",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_f)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_f);

  /* "/home/zefiris/pyode/src/body.pyx":266 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddRelForce(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.addRelForce");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_f);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_addRelTorque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_addRelTorque[] = "addRelTorque(t)\n\n        Add an external torque t given in relative coordinates\n        (relative to the body\'s own frame of reference).\n\n        @param t: Torque\n        @type t: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_addRelTorque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_t = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"t",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_t)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_t);

  /* "/home/zefiris/pyode/src/body.pyx":278 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddRelTorque(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.addRelTorque");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_t);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_addForceAtPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_addForceAtPos[] = "addForceAtPos(f, p)\n\n        Add an external force f at position p. Both arguments must be\n        given in absolute coordinates.\n\n        @param f: Force\n        @param p: Position\n        @type f: 3-sequence of floats\n        @type p: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_addForceAtPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  dReal __pyx_6;
  dReal __pyx_7;
  dReal __pyx_8;
  static char *__pyx_argnames[] = {"f","p",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_f, &__pyx_v_p)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_f);
  Py_INCREF(__pyx_v_p);

  /* "/home/zefiris/pyode/src/body.pyx":292 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_7 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_8 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddForceAtPos(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5,__pyx_6,__pyx_7,__pyx_8);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.addForceAtPos");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_f);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_addForceAtRelPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_addForceAtRelPos[] = "addForceAtRelPos(f, p)\n\n        Add an external force f at position p. f is given in absolute\n        coordinates and p in absolute coordinates.\n\n        @param f: Force\n        @param p: Position\n        @type f: 3-sequence of floats\n        @type p: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_addForceAtRelPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  dReal __pyx_6;
  dReal __pyx_7;
  dReal __pyx_8;
  static char *__pyx_argnames[] = {"f","p",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_f, &__pyx_v_p)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_f);
  Py_INCREF(__pyx_v_p);

  /* "/home/zefiris/pyode/src/body.pyx":306 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_7 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_8 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddForceAtRelPos(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5,__pyx_6,__pyx_7,__pyx_8);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.addForceAtRelPos");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_f);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_addRelForceAtPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_addRelForceAtPos[] = "addRelForceAtPos(f, p)\n\n        Add an external force f at position p. f is given in relative\n        coordinates and p in relative coordinates.\n\n        @param f: Force\n        @param p: Position\n        @type f: 3-sequence of floats\n        @type p: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_addRelForceAtPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  dReal __pyx_6;
  dReal __pyx_7;
  dReal __pyx_8;
  static char *__pyx_argnames[] = {"f","p",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_f, &__pyx_v_p)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_f);
  Py_INCREF(__pyx_v_p);

  /* "/home/zefiris/pyode/src/body.pyx":320 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_7 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_8 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 320; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddRelForceAtPos(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5,__pyx_6,__pyx_7,__pyx_8);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.addRelForceAtPos");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_f);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_addRelForceAtRelPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_addRelForceAtRelPos[] = "addRelForceAtRelPos(f, p)\n\n        Add an external force f at position p. Both arguments must be\n        given in relative coordinates.\n\n        @param f: Force\n        @param p: Position\n        @type f: 3-sequence of floats\n        @type p: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_addRelForceAtRelPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  dReal __pyx_6;
  dReal __pyx_7;
  dReal __pyx_8;
  static char *__pyx_argnames[] = {"f","p",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_f, &__pyx_v_p)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_f);
  Py_INCREF(__pyx_v_p);

  /* "/home/zefiris/pyode/src/body.pyx":334 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_7 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_8 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddRelForceAtRelPos(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5,__pyx_6,__pyx_7,__pyx_8);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.addRelForceAtRelPos");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_f);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getForce[] = "getForce() -> 3-tuple\n\n        Return the current accumulated force.\n        ";
static PyObject *__pyx_f_3ode_4Body_getForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dReal (*__pyx_v_f);
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":344 */
  __pyx_v_f = ((dReal (*))dBodyGetForce(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid));

  /* "/home/zefiris/pyode/src/body.pyx":345 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_f[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 345; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_f[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 345; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_f[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 345; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 345; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Body.getForce");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getTorque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getTorque[] = "getTorque() -> 3-tuple\n\n        Return the current accumulated torque.\n        ";
static PyObject *__pyx_f_3ode_4Body_getTorque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dReal (*__pyx_v_f);
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":355 */
  __pyx_v_f = ((dReal (*))dBodyGetTorque(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid));

  /* "/home/zefiris/pyode/src/body.pyx":356 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_f[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 356; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_f[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 356; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_f[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 356; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 356; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Body.getTorque");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_setForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_setForce[] = "setForce(f)\n\n        Set the body force accumulation vector.\n\n        @param f: Force\n        @type f: 3-tuple of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_setForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"f",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_f)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_f);

  /* "/home/zefiris/pyode/src/body.pyx":367 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 367; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 367; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 367; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 367; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 367; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 367; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 367; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 367; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 367; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodySetForce(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.setForce");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_f);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_setTorque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_setTorque[] = "setTorque(t)\n\n        Set the body torque accumulation vector.\n\n        @param t: Torque\n        @type t: 3-tuple of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_setTorque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_t = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"t",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_t)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_t);

  /* "/home/zefiris/pyode/src/body.pyx":378 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 378; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 378; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 378; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 378; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 378; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 378; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 378; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 378; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 378; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodySetTorque(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.setTorque");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_t);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getRelPointPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getRelPointPos[] = "getRelPointPos(p) -> 3-tuple\n\n        Utility function that takes a point p on a body and returns\n        that point\'s position in global coordinates. The point p\n        must be given in body relative coordinates.\n\n        @param p: Body point (local coordinates)\n        @type p: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_getRelPointPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_p = 0;
  dVector3 __pyx_v_res;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {"p",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_p)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_p);

  /* "/home/zefiris/pyode/src/body.pyx":393 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 393; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 393; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 393; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 393; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 393; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 393; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 393; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 393; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 393; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyGetRelPointPos(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5,__pyx_v_res);

  /* "/home/zefiris/pyode/src/body.pyx":394 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 394; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 394; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 394; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 394; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_7, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_7, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_7, 2, __pyx_6);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_6 = 0;
  __pyx_r = __pyx_7;
  __pyx_7 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("ode.Body.getRelPointPos");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getRelPointVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getRelPointVel[] = "getRelPointVel(p) -> 3-tuple\n\n        Utility function that takes a point p on a body and returns\n        that point\'s velocity in global coordinates. The point p\n        must be given in body relative coordinates.\n\n        @param p: Body point (local coordinates)\n        @type p: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_getRelPointVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_p = 0;
  dVector3 __pyx_v_res;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {"p",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_p)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_p);

  /* "/home/zefiris/pyode/src/body.pyx":408 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 408; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 408; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 408; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 408; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 408; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 408; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 408; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 408; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 408; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyGetRelPointVel(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5,__pyx_v_res);

  /* "/home/zefiris/pyode/src/body.pyx":409 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 409; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 409; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 409; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 409; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_7, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_7, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_7, 2, __pyx_6);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_6 = 0;
  __pyx_r = __pyx_7;
  __pyx_7 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("ode.Body.getRelPointVel");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getPointVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getPointVel[] = "getPointVel(p) -> 3-tuple\n\n        Utility function that takes a point p on a body and returns\n        that point\'s velocity in global coordinates. The point p\n        must be given in global coordinates.\n\n        @param p: Body point (global coordinates)\n        @type p: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_getPointVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_p = 0;
  dVector3 __pyx_v_res;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {"p",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_p)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_p);

  /* "/home/zefiris/pyode/src/body.pyx":423 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 423; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 423; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 423; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 423; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 423; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 423; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 423; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 423; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 423; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyGetPointVel(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5,__pyx_v_res);

  /* "/home/zefiris/pyode/src/body.pyx":424 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 424; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 424; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 424; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 424; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_7, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_7, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_7, 2, __pyx_6);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_6 = 0;
  __pyx_r = __pyx_7;
  __pyx_7 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("ode.Body.getPointVel");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getPosRelPoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getPosRelPoint[] = "getPosRelPoint(p) -> 3-tuple\n\n        This is the inverse of getRelPointPos(). It takes a point p in\n        global coordinates and returns the point\'s position in\n        body-relative coordinates.\n\n        @param p: Body point (global coordinates)\n        @type p: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_getPosRelPoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_p = 0;
  dVector3 __pyx_v_res;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {"p",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_p)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_p);

  /* "/home/zefiris/pyode/src/body.pyx":438 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 438; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 438; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 438; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 438; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 438; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 438; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 438; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 438; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 438; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyGetPosRelPoint(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5,__pyx_v_res);

  /* "/home/zefiris/pyode/src/body.pyx":439 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 439; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 439; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 439; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 439; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_7, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_7, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_7, 2, __pyx_6);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_6 = 0;
  __pyx_r = __pyx_7;
  __pyx_7 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("ode.Body.getPosRelPoint");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_vectorToWorld(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_vectorToWorld[] = "vectorToWorld(v) -> 3-tuple\n\n        Given a vector v expressed in the body coordinate system, rotate\n        it to the world coordinate system.\n\n        @param v: Vector in body coordinate system\n        @type v: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_vectorToWorld(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_v = 0;
  dVector3 __pyx_v_res;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {"v",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_v)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_v);

  /* "/home/zefiris/pyode/src/body.pyx":452 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 452; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 452; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 452; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 452; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 452; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 452; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 452; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 452; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 452; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyVectorToWorld(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5,__pyx_v_res);

  /* "/home/zefiris/pyode/src/body.pyx":453 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 453; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 453; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 453; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 453; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_7, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_7, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_7, 2, __pyx_6);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_6 = 0;
  __pyx_r = __pyx_7;
  __pyx_7 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("ode.Body.vectorToWorld");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_v);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_vectorFromWorld(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_vectorFromWorld[] = "vectorFromWorld(v) -> 3-tuple\n\n        Given a vector v expressed in the world coordinate system, rotate\n        it to the body coordinate system.\n\n        @param v: Vector in world coordinate system\n        @type v: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_vectorFromWorld(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_v = 0;
  dVector3 __pyx_v_res;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {"v",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_v)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_v);

  /* "/home/zefiris/pyode/src/body.pyx":466 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 466; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 466; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 466; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 466; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 466; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 466; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 466; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 466; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 466; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyVectorFromWorld(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5,__pyx_v_res);

  /* "/home/zefiris/pyode/src/body.pyx":467 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 467; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 467; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 467; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 467; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_7, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_7, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_7, 2, __pyx_6);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_6 = 0;
  __pyx_r = __pyx_7;
  __pyx_7 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("ode.Body.vectorFromWorld");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_v);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_enable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_enable[] = "enable()\n\n        Manually enable a body.\n        ";
static PyObject *__pyx_f_3ode_4Body_enable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":476 */
  dBodyEnable(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_disable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_disable[] = "disable()\n\n        Manually disable a body. Note that a disabled body that is connected\n        through a joint to an enabled body will be automatically re-enabled\n        at the next simulation step.\n        ";
static PyObject *__pyx_f_3ode_4Body_disable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":486 */
  dBodyDisable(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_isEnabled(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_isEnabled[] = "isEnabled() -> bool\n\n        Check if a body is currently enabled.\n        ";
static PyObject *__pyx_f_3ode_4Body_isEnabled(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":494 */
  __pyx_1 = PyInt_FromLong(dBodyIsEnabled(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid)); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 494; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Body.isEnabled");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_setFiniteRotationMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_setFiniteRotationMode[] = "setFiniteRotationMode(mode)\n\n        This function controls the way a body\'s orientation is updated at\n        each time step. The mode argument can be:\n        \n         - 0: An \"infinitesimal\" orientation update is used. This is\n           fast to compute, but it can occasionally cause inaccuracies\n           for bodies that are rotating at high speed, especially when\n           those bodies are joined to other bodies. This is the default\n           for every new body that is created.\n        \n         - 1: A \"finite\" orientation update is used. This is more\n           costly to compute, but will be more accurate for high speed\n           rotations. Note however that high speed rotations can result\n           in many types of error in a simulation, and this mode will\n           only fix one of those sources of error.\n\n        @param mode: Rotation mode (0/1)\n        @type mode: int\n        ";
static PyObject *__pyx_f_3ode_4Body_setFiniteRotationMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"mode",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_mode)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_mode);

  /* "/home/zefiris/pyode/src/body.pyx":518 */
  __pyx_1 = PyInt_AsLong(__pyx_v_mode); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 518; goto __pyx_L1;}
  dBodySetFiniteRotationMode(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Body.setFiniteRotationMode");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_mode);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getFiniteRotationMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getFiniteRotationMode[] = "getFiniteRotationMode() -> mode (0/1)\n\n        Return the current finite rotation mode of a body (0 or 1).\n        See setFiniteRotationMode().\n        ";
static PyObject *__pyx_f_3ode_4Body_getFiniteRotationMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":527 */
  __pyx_1 = PyInt_FromLong(dBodyGetFiniteRotationMode(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid)); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 527; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Body.getFiniteRotationMode");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_setFiniteRotationAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_setFiniteRotationAxis[] = "setFiniteRotationAxis(a)\n\n        Set the finite rotation axis of the body.  This axis only has a\n        meaning when the finite rotation mode is set\n        (see setFiniteRotationMode()).\n        \n        @param a: Axis\n        @type a: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_4Body_setFiniteRotationAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"a",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_a)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_a);

  /* "/home/zefiris/pyode/src/body.pyx":540 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 540; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_a, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 540; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 540; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 540; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_a, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 540; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 540; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 540; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_a, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 540; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 540; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodySetFiniteRotationAxis(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Body.setFiniteRotationAxis");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_a);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getFiniteRotationAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getFiniteRotationAxis[] = "getFiniteRotationAxis() -> 3-tuple\n\n        Return the current finite rotation axis of the body.\n        ";
static PyObject *__pyx_f_3ode_4Body_getFiniteRotationAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":550 */
  dBodyGetFiniteRotationAxis(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_v_p);

  /* "/home/zefiris/pyode/src/body.pyx":551 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 551; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 551; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 551; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 551; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Body.getFiniteRotationAxis");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getNumJoints(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getNumJoints[] = "getNumJoints() -> int\n\n        Return the number of joints that are attached to this body.\n        ";
static PyObject *__pyx_f_3ode_4Body_getNumJoints(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":559 */
  __pyx_1 = PyInt_FromLong(dBodyGetNumJoints(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid)); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 559; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Body.getNumJoints");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_setGravityMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_setGravityMode[] = "setGravityMode(mode)\n\n        Set whether the body is influenced by the world\'s gravity\n        or not. If mode is True it is, otherwise it isn\'t.\n        Newly created bodies are always influenced by the world\'s gravity.\n\n        @param mode: Gravity mode\n        @type mode: bool\n        ";
static PyObject *__pyx_f_3ode_4Body_setGravityMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"mode",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_mode)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_mode);

  /* "/home/zefiris/pyode/src/body.pyx":572 */
  __pyx_1 = PyInt_AsLong(__pyx_v_mode); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 572; goto __pyx_L1;}
  dBodySetGravityMode(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Body.setGravityMode");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_mode);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_4Body_getGravityMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_4Body_getGravityMode[] = "getGravityMode() -> bool\n\n        Return True if the body is influenced by the world\'s gravity.\n        ";
static PyObject *__pyx_f_3ode_4Body_getGravityMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/body.pyx":580 */
  __pyx_1 = PyInt_FromLong(dBodyGetGravityMode(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid)); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 580; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Body.getGravityMode");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_3ode_10JointGroup___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_10JointGroup___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":51 */
  ((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->gid = dJointGroupCreate(0);

  __pyx_r = 0;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_3ode_10JointGroup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_10JointGroup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":54 */
  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 54; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->jointlist);
  ((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->jointlist = __pyx_1;
  __pyx_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.JointGroup.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n__destroyed;

static void __pyx_f_3ode_10JointGroup___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_f_3ode_10JointGroup___dealloc__(PyObject *__pyx_v_self) {
  PyObject *__pyx_v_j;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF(__pyx_v_self);
  __pyx_v_j = Py_None; Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/joints.pyx":57 */
  __pyx_1 = (((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->gid != NULL);
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":58 */
    __pyx_2 = PyObject_GetIter(((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->jointlist); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 58; goto __pyx_L1;}
    for (;;) {
      __pyx_3 = PyIter_Next(__pyx_2);
      if (!__pyx_3) {
        if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 58; goto __pyx_L1;}
        break;
      }
      Py_DECREF(__pyx_v_j);
      __pyx_v_j = __pyx_3;
      __pyx_3 = 0;

      /* "/home/zefiris/pyode/src/joints.pyx":59 */
      __pyx_3 = PyObject_GetAttr(__pyx_v_j, __pyx_n__destroyed); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; goto __pyx_L1;}
      __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; goto __pyx_L1;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
    }
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/zefiris/pyode/src/joints.pyx":60 */
    dJointGroupDestroy(((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->gid);
    goto __pyx_L2;
  }
  __pyx_L2:;

  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.JointGroup.__dealloc__");
  __pyx_L0:;
  Py_DECREF(__pyx_v_j);
  Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_f_3ode_10JointGroup_empty(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10JointGroup_empty[] = "empty()\n\n        Destroy all joints in the group.\n        ";
static PyObject *__pyx_f_3ode_10JointGroup_empty(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_j;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);
  __pyx_v_j = Py_None; Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/joints.pyx":68 */
  dJointGroupEmpty(((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->gid);

  /* "/home/zefiris/pyode/src/joints.pyx":69 */
  __pyx_1 = PyObject_GetIter(((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->jointlist); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 69; goto __pyx_L1;}
  for (;;) {
    __pyx_2 = PyIter_Next(__pyx_1);
    if (!__pyx_2) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 69; goto __pyx_L1;}
      break;
    }
    Py_DECREF(__pyx_v_j);
    __pyx_v_j = __pyx_2;
    __pyx_2 = 0;

    /* "/home/zefiris/pyode/src/joints.pyx":70 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_j, __pyx_n__destroyed); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 70; goto __pyx_L1;}
    __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 70; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/joints.pyx":71 */
  __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 71; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->jointlist);
  ((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->jointlist = __pyx_2;
  __pyx_2 = 0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.JointGroup.empty");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_j);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_append;

static PyObject *__pyx_f_3ode_10JointGroup__addjoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10JointGroup__addjoint[] = "_addjoint(j)\n\n        Add a joint to the group.  This is an internal method that is\n        called by the joints.  The group has to know the Python\n        wrappers because it has to notify them when the group is\n        emptied (so that the ODE joints won\'t get destroyed\n        twice). The notification is done by calling _destroyed() on\n        the Python joints.\n\n        @param j: The joint to add\n        @type j: Joint\n        ";
static PyObject *__pyx_f_3ode_10JointGroup__addjoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_j = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"j",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_j)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_j);

  /* "/home/zefiris/pyode/src/joints.pyx":87 */
  __pyx_1 = PyObject_GetAttr(((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->jointlist, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 87; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 87; goto __pyx_L1;}
  Py_INCREF(__pyx_v_j);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_j);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 87; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.JointGroup._addjoint");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_j);
  return __pyx_r;
}

static int __pyx_f_3ode_5Joint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_5Joint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_a, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_a);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":112 */
  ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid = NULL;

  /* "/home/zefiris/pyode/src/joints.pyx":113 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->world);
  ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->world = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":114 */
  ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback = NULL;

  /* "/home/zefiris/pyode/src/joints.pyx":115 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->body1);
  ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->body1 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":116 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->body2);
  ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->body2 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":117 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 117; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->userattribs);
  ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->userattribs = __pyx_1;
  __pyx_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Joint.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_a);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_self);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static PyObject *__pyx_n_NotImplementedError;

static PyObject *__pyx_k81p;

static char (__pyx_k81[]) = "The Joint base class can't be used directly.";

static int __pyx_f_3ode_5Joint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_5Joint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_a, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_a);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":120 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 120; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k81p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[4]; __pyx_lineno = 120; goto __pyx_L1;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Joint.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_a);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_self);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static PyObject *__pyx_n_setFeedback;
static PyObject *__pyx_n_False;

static void __pyx_f_3ode_5Joint___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_f_3ode_5Joint___dealloc__(PyObject *__pyx_v_self) {
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":123 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_setFeedback); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 123; goto __pyx_L1;}
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 123; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 123; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
  __pyx_2 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 123; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/zefiris/pyode/src/joints.pyx":124 */
  __pyx_4 = (((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid != NULL);
  if (__pyx_4) {

    /* "/home/zefiris/pyode/src/joints.pyx":125 */
    dJointDestroy(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid);
    goto __pyx_L2;
  }
  __pyx_L2:;

  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.Joint.__dealloc__");
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_k82p;

static char (__pyx_k82[]) = "Joint object has no attribute '%s'";

static PyObject *__pyx_f_3ode_5Joint___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_f_3ode_5Joint___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_name);

  /* "/home/zefiris/pyode/src/joints.pyx":128 */
  /*try:*/ {

    /* "/home/zefiris/pyode/src/joints.pyx":129 */
    __pyx_1 = PyObject_GetItem(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->userattribs, __pyx_v_name); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 129; goto __pyx_L2;}
    __pyx_r = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L0;
  }
  goto __pyx_L3;
  __pyx_L2:;
  Py_XDECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/joints.pyx":130 */
  /*except:*/ {
    __Pyx_AddTraceback("ode.__getattr__");
    __pyx_1 = __Pyx_GetExcValue(); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 130; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;

    /* "/home/zefiris/pyode/src/joints.pyx":131 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 131; goto __pyx_L1;}
    __pyx_2 = PyNumber_Remainder(__pyx_k82p, __pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 131; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_2, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 131; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Joint.__getattr__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_name);
  return __pyx_r;
}

static int __pyx_f_3ode_5Joint___setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /*proto*/
static int __pyx_f_3ode_5Joint___setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  int __pyx_r;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_name);
  Py_INCREF(__pyx_v_value);

  /* "/home/zefiris/pyode/src/joints.pyx":134 */
  if (PyObject_SetItem(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->userattribs, __pyx_v_name, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 134; goto __pyx_L1;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Joint.__setattr__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_name);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}

static PyObject *__pyx_k83p;

static char (__pyx_k83[]) = "Joint object has no attribute '%s'";

static int __pyx_f_3ode_5Joint___delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static int __pyx_f_3ode_5Joint___delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_name);

  /* "/home/zefiris/pyode/src/joints.pyx":137 */
  /*try:*/ {

    /* "/home/zefiris/pyode/src/joints.pyx":138 */
    if (PyObject_DelItem(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->userattribs, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 138; goto __pyx_L2;}
  }
  goto __pyx_L3;
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/joints.pyx":139 */
  /*except:*/ {
    __Pyx_AddTraceback("ode.__delattr__");
    __pyx_1 = __Pyx_GetExcValue(); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 139; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;

    /* "/home/zefiris/pyode/src/joints.pyx":140 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 140; goto __pyx_L1;}
    __pyx_2 = PyNumber_Remainder(__pyx_k83p, __pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 140; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_2, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 140; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Joint.__delattr__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_name);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5Joint__destroyed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5Joint__destroyed[] = "Notify the joint object about an external destruction of the ODE joint.\n\n        This method has to be called when the underlying ODE object\n        was destroyed by someone else (e.g. by a joint group). The Python\n        wrapper will then refrain from destroying it again.\n        ";
static PyObject *__pyx_f_3ode_5Joint__destroyed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":150 */
  ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid = NULL;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5Joint_attach(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5Joint_attach[] = "attach(body1, body2)\n\n        Attach the joint to some new bodies. A body can be attached\n        to the environment by passing None as second body.\n        \n        @param body1: First body\n        @param body2: Second body\n        @type body1: Body\n        @type body2: Body\n        ";
static PyObject *__pyx_f_3ode_5Joint_attach(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_Body *__pyx_v_body1 = 0;
  struct __pyx_obj_3ode_Body *__pyx_v_body2 = 0;
  dBodyID __pyx_v_id1;
  dBodyID __pyx_v_id2;
  PyObject *__pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"body1","body2",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_body1, &__pyx_v_body2)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_body1);
  Py_INCREF(__pyx_v_body2);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_body1), __pyx_ptype_3ode_Body, 1, "body1")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 153; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_body2), __pyx_ptype_3ode_Body, 1, "body2")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 153; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":166 */
  if (PyObject_Cmp(((PyObject *)__pyx_v_body1), Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 166; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":167 */
    __pyx_v_id1 = NULL;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/zefiris/pyode/src/joints.pyx":169 */
    __pyx_v_id1 = __pyx_v_body1->bid;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/joints.pyx":171 */
  if (PyObject_Cmp(((PyObject *)__pyx_v_body2), Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 171; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":172 */
    __pyx_v_id2 = NULL;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/zefiris/pyode/src/joints.pyx":174 */
    __pyx_v_id2 = __pyx_v_body2->bid;
  }
  __pyx_L3:;

  /* "/home/zefiris/pyode/src/joints.pyx":176 */
  Py_INCREF(((PyObject *)__pyx_v_body1));
  Py_DECREF(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->body1);
  ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->body1 = ((PyObject *)__pyx_v_body1);

  /* "/home/zefiris/pyode/src/joints.pyx":177 */
  Py_INCREF(((PyObject *)__pyx_v_body2));
  Py_DECREF(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->body2);
  ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->body2 = ((PyObject *)__pyx_v_body2);

  /* "/home/zefiris/pyode/src/joints.pyx":178 */
  dJointAttach(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid,__pyx_v_id1,__pyx_v_id2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Joint.attach");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_body1);
  Py_DECREF(__pyx_v_body2);
  return __pyx_r;
}

static PyObject *__pyx_n_IndexError;

static PyObject *__pyx_f_3ode_5Joint_getBody(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5Joint_getBody[] = "getBody(index) -> Body\n\n        Return the bodies that this joint connects. If index is 0 the\n        \"first\" body will be returned, corresponding to the body1\n        argument of the attach() method. If index is 1 the \"second\" body\n        will be returned, corresponding to the body2 argument of the\n        attach() method.\n\n        @param index: Bodx index (0 or 1).\n        @type index: int\n        ";
static PyObject *__pyx_f_3ode_5Joint_getBody(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"index",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_index)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_index);

  /* "/home/zefiris/pyode/src/joints.pyx":194 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 194; goto __pyx_L1;}
  if (PyObject_Cmp(__pyx_v_index, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 194; goto __pyx_L1;}
  __pyx_2 = __pyx_2 == 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/zefiris/pyode/src/joints.pyx":195 */
    Py_INCREF(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->body1);
    __pyx_r = ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->body1;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 196; goto __pyx_L1;}
  if (PyObject_Cmp(__pyx_v_index, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 196; goto __pyx_L1;}
  __pyx_2 = __pyx_2 == 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/zefiris/pyode/src/joints.pyx":197 */
    Py_INCREF(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->body2);
    __pyx_r = ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->body2;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/zefiris/pyode/src/joints.pyx":199 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_IndexError); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 199; goto __pyx_L1;}
    __pyx_3 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 199; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __Pyx_Raise(__pyx_3, 0, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 199; goto __pyx_L1;}
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.Joint.getBody");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_index);
  return __pyx_r;
}

static PyObject *__pyx_n_MemoryError;

static PyObject *__pyx_k84p;

static char (__pyx_k84[]) = "can't allocate feedback buffer";

static PyObject *__pyx_f_3ode_5Joint_setFeedback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5Joint_setFeedback[] = "setFeedback(flag=True)\n\n        Create a feedback buffer. If flag is True then a buffer is\n        allocated and the forces/torques applied by the joint can\n        be read using the getFeedback() method. If flag is False the\n        buffer is released.\n\n        @param flag: Specifies whether a buffer should be created or released\n        @type flag: bool\n        ";
static PyObject *__pyx_f_3ode_5Joint_setFeedback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_flag = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"flag",0};
  __pyx_v_flag = __pyx_k4;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_flag)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_flag);

  /* "/home/zefiris/pyode/src/joints.pyx":214 */
  __pyx_1 = PyObject_IsTrue(__pyx_v_flag); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 214; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":216 */
    __pyx_1 = (((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback != NULL);
    if (__pyx_1) {

      /* "/home/zefiris/pyode/src/joints.pyx":217 */
      __pyx_r = Py_None; Py_INCREF(Py_None);
      goto __pyx_L0;
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/zefiris/pyode/src/joints.pyx":219 */
    ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback = ((dJointFeedback (*))malloc((sizeof(dJointFeedback ))));

    /* "/home/zefiris/pyode/src/joints.pyx":220 */
    __pyx_1 = (((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback == NULL);
    if (__pyx_1) {

      /* "/home/zefiris/pyode/src/joints.pyx":221 */
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_MemoryError); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 221; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 221; goto __pyx_L1;}
      Py_INCREF(__pyx_k84p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k84p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 221; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      __Pyx_Raise(__pyx_4, 0, 0);
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 221; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/zefiris/pyode/src/joints.pyx":222 */
    dJointSetFeedback(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid,((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback);
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/zefiris/pyode/src/joints.pyx":224 */
    __pyx_1 = (((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback != NULL);
    if (__pyx_1) {

      /* "/home/zefiris/pyode/src/joints.pyx":226 */
      dJointSetFeedback(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid,NULL);

      /* "/home/zefiris/pyode/src/joints.pyx":227 */
      free(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback);

      /* "/home/zefiris/pyode/src/joints.pyx":228 */
      ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback = NULL;
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Joint.setFeedback");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_flag);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_5Joint_getFeedback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_5Joint_getFeedback[] = "getFeedback() -> (force1, torque1, force2, torque2)\n\n        Get the forces/torques applied by the joint. If feedback is\n        activated (i.e. setFeedback(True) was called) then this method\n        returns a tuple (force1, torque1, force2, torque2) with the\n        forces and torques applied to body 1 and body 2.  The\n        forces/torques are given as 3-tuples.\n\n        If feedback is deactivated then the method always returns None.\n        ";
static PyObject *__pyx_f_3ode_5Joint_getFeedback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dJointFeedback (*__pyx_v_fb);
  PyObject *__pyx_v_f1;
  PyObject *__pyx_v_t1;
  PyObject *__pyx_v_f2;
  PyObject *__pyx_v_t2;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);
  __pyx_v_f1 = Py_None; Py_INCREF(Py_None);
  __pyx_v_t1 = Py_None; Py_INCREF(Py_None);
  __pyx_v_f2 = Py_None; Py_INCREF(Py_None);
  __pyx_v_t2 = Py_None; Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/joints.pyx":244 */
  __pyx_v_fb = dJointGetFeedback(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid);

  /* "/home/zefiris/pyode/src/joints.pyx":245 */
  __pyx_1 = (__pyx_v_fb == NULL);
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":246 */
    Py_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/joints.pyx":248 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_fb->f1[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 248; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_fb->f1[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 248; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_fb->f1[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 248; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 248; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
  PyTuple_SET_ITEM(__pyx_5, 2, __pyx_4);
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_4 = 0;
  Py_DECREF(__pyx_v_f1);
  __pyx_v_f1 = __pyx_5;
  __pyx_5 = 0;

  /* "/home/zefiris/pyode/src/joints.pyx":249 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_fb->t1[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 249; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_fb->t1[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 249; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_fb->t1[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 249; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 249; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
  PyTuple_SET_ITEM(__pyx_5, 2, __pyx_4);
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_4 = 0;
  Py_DECREF(__pyx_v_t1);
  __pyx_v_t1 = __pyx_5;
  __pyx_5 = 0;

  /* "/home/zefiris/pyode/src/joints.pyx":250 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_fb->f2[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 250; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_fb->f2[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 250; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_fb->f2[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 250; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 250; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
  PyTuple_SET_ITEM(__pyx_5, 2, __pyx_4);
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_4 = 0;
  Py_DECREF(__pyx_v_f2);
  __pyx_v_f2 = __pyx_5;
  __pyx_5 = 0;

  /* "/home/zefiris/pyode/src/joints.pyx":251 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_fb->t2[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_fb->t2[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_fb->t2[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
  PyTuple_SET_ITEM(__pyx_5, 2, __pyx_4);
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_4 = 0;
  Py_DECREF(__pyx_v_t2);
  __pyx_v_t2 = __pyx_5;
  __pyx_5 = 0;

  /* "/home/zefiris/pyode/src/joints.pyx":252 */
  __pyx_2 = PyTuple_New(4); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 252; goto __pyx_L1;}
  Py_INCREF(__pyx_v_f1);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_f1);
  Py_INCREF(__pyx_v_t1);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_t1);
  Py_INCREF(__pyx_v_f2);
  PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_f2);
  Py_INCREF(__pyx_v_t2);
  PyTuple_SET_ITEM(__pyx_2, 3, __pyx_v_t2);
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("ode.Joint.getFeedback");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_f1);
  Py_DECREF(__pyx_v_t1);
  Py_DECREF(__pyx_v_f2);
  Py_DECREF(__pyx_v_t2);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_3ode_9BallJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_9BallJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  struct __pyx_obj_3ode_JointGroup *__pyx_v_jg;
  dJointGroupID __pyx_v_jgid;
  int __pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k5;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)Py_None); Py_INCREF(Py_None);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 266; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":270 */
  __pyx_v_jgid = NULL;

  /* "/home/zefiris/pyode/src/joints.pyx":271 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 271; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":272 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 272; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)__pyx_v_jointgroup);

    /* "/home/zefiris/pyode/src/joints.pyx":273 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/joints.pyx":274 */
  ((struct __pyx_obj_3ode_BallJoint *)__pyx_v_self)->__pyx_base.jid = dJointCreateBall(__pyx_v_world->wid,__pyx_v_jgid);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.BallJoint.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static PyObject *__pyx_n__addjoint;

static int __pyx_f_3ode_9BallJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_9BallJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k6;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 276; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":277 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_3ode_BallJoint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_3ode_BallJoint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

  /* "/home/zefiris/pyode/src/joints.pyx":278 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":279 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 279; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 279; goto __pyx_L1;}
    Py_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 279; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.BallJoint.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9BallJoint_setAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_9BallJoint_setAnchor[] = "setAnchor(pos)\n\n        Set the joint anchor point which must be specified in world\n        coordinates.\n\n        @param pos: Anchor position\n        @type pos: 3-sequence of floats         \n        ";
static PyObject *__pyx_f_3ode_9BallJoint_setAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"pos",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pos)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_pos);

  /* "/home/zefiris/pyode/src/joints.pyx":291 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 291; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 291; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 291; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 291; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 291; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 291; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 291; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 291; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 291; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetBallAnchor(((struct __pyx_obj_3ode_BallJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.BallJoint.setAnchor");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_pos);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9BallJoint_getAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_9BallJoint_getAnchor[] = "getAnchor() -> 3-tuple of floats\n\n        Get the joint anchor point, in world coordinates.  This\n        returns the point on body 1.  If the joint is perfectly\n        satisfied, this will be the same as the point on body 2.\n        ";
static PyObject *__pyx_f_3ode_9BallJoint_getAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":303 */
  dJointGetBallAnchor(((struct __pyx_obj_3ode_BallJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/zefiris/pyode/src/joints.pyx":304 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 304; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 304; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 304; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 304; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.BallJoint.getAnchor");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9BallJoint_getAnchor2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_9BallJoint_getAnchor2[] = "getAnchor2() -> 3-tuple of floats\n\n        Get the joint anchor point, in world coordinates.  This\n        returns the point on body 2. If the joint is perfectly\n        satisfied, this will be the same as the point on body 1.\n        ";
static PyObject *__pyx_f_3ode_9BallJoint_getAnchor2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":316 */
  dJointGetBallAnchor2(((struct __pyx_obj_3ode_BallJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/zefiris/pyode/src/joints.pyx":317 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 317; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 317; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 317; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 317; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.BallJoint.getAnchor2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9BallJoint_setParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_9BallJoint_setParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {"param","value",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_param, &__pyx_v_value)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);
  Py_INCREF(__pyx_v_value);

  /* "/home/zefiris/pyode/src/joints.pyx":322 */

  __pyx_r = Py_None; Py_INCREF(Py_None);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9BallJoint_getParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_9BallJoint_getParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {"param",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_param)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);

  /* "/home/zefiris/pyode/src/joints.pyx":326 */
  __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 326; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.BallJoint.getParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  return __pyx_r;
}

static int __pyx_f_3ode_10HingeJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_10HingeJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  struct __pyx_obj_3ode_JointGroup *__pyx_v_jg;
  dJointGroupID __pyx_v_jgid;
  int __pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k7;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)Py_None); Py_INCREF(Py_None);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 338; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":342 */
  __pyx_v_jgid = NULL;

  /* "/home/zefiris/pyode/src/joints.pyx":343 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 343; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":344 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 344; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)__pyx_v_jointgroup);

    /* "/home/zefiris/pyode/src/joints.pyx":345 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/joints.pyx":346 */
  ((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid = dJointCreateHinge(__pyx_v_world->wid,__pyx_v_jgid);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.HingeJoint.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static int __pyx_f_3ode_10HingeJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_10HingeJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k8;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 348; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":349 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

  /* "/home/zefiris/pyode/src/joints.pyx":350 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":351 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 351; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 351; goto __pyx_L1;}
    Py_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 351; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.HingeJoint.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10HingeJoint_setAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10HingeJoint_setAnchor[] = "setAnchor(pos)\n\n        Set the hinge anchor which must be given in world coordinates.\n\n        @param pos: Anchor position\n        @type pos: 3-sequence of floats         \n        ";
static PyObject *__pyx_f_3ode_10HingeJoint_setAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"pos",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pos)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_pos);

  /* "/home/zefiris/pyode/src/joints.pyx":362 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 362; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 362; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 362; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 362; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 362; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 362; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 362; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 362; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 362; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetHingeAnchor(((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.HingeJoint.setAnchor");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_pos);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10HingeJoint_getAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10HingeJoint_getAnchor[] = "getAnchor() -> 3-tuple of floats\n\n        Get the joint anchor point, in world coordinates. This returns\n        the point on body 1. If the joint is perfectly satisfied, this\n        will be the same as the point on body 2.\n        ";
static PyObject *__pyx_f_3ode_10HingeJoint_getAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":373 */
  dJointGetHingeAnchor(((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/zefiris/pyode/src/joints.pyx":374 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 374; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 374; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 374; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 374; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.HingeJoint.getAnchor");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10HingeJoint_getAnchor2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10HingeJoint_getAnchor2[] = "getAnchor2() -> 3-tuple of floats\n\n        Get the joint anchor point, in world coordinates. This returns\n        the point on body 2. If the joint is perfectly satisfied, this\n        will be the same as the point on body 1.\n        ";
static PyObject *__pyx_f_3ode_10HingeJoint_getAnchor2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":385 */
  dJointGetHingeAnchor2(((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/zefiris/pyode/src/joints.pyx":386 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 386; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 386; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 386; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 386; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.HingeJoint.getAnchor2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10HingeJoint_setAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10HingeJoint_setAxis[] = "setAxis(axis)\n\n        Set the hinge axis.\n\n        @param axis: Hinge axis\n        @type axis: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_10HingeJoint_setAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_axis = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"axis",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_axis)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_axis);

  /* "/home/zefiris/pyode/src/joints.pyx":397 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 397; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 397; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 397; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 397; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 397; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 397; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 397; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 397; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 397; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetHingeAxis(((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.HingeJoint.setAxis");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_axis);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10HingeJoint_getAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10HingeJoint_getAxis[] = "getAxis() -> 3-tuple of floats\n\n        Get the hinge axis.\n        ";
static PyObject *__pyx_f_3ode_10HingeJoint_getAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":406 */
  dJointGetHingeAxis(((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

  /* "/home/zefiris/pyode/src/joints.pyx":407 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.HingeJoint.getAxis");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10HingeJoint_getAngle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10HingeJoint_getAngle[] = "getAngle() -> float\n\n        Get the hinge angle. The angle is measured between the two\n        bodies, or between the body and the static environment. The\n        angle will be between -pi..pi.\n\n        When the hinge anchor or axis is set, the current position of\n        the attached bodies is examined and that position will be the\n        zero angle.\n        ";
static PyObject *__pyx_f_3ode_10HingeJoint_getAngle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":422 */
  __pyx_1 = PyFloat_FromDouble(dJointGetHingeAngle(((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 422; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.HingeJoint.getAngle");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10HingeJoint_getAngleRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10HingeJoint_getAngleRate[] = "getAngleRate() -> float\n\n        Get the time derivative of the angle.\n        ";
static PyObject *__pyx_f_3ode_10HingeJoint_getAngleRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":430 */
  __pyx_1 = PyFloat_FromDouble(dJointGetHingeAngleRate(((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 430; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.HingeJoint.getAngleRate");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10HingeJoint_addTorque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10HingeJoint_addTorque[] = "addTorque(torque)\n\n        Applies the torque about the hinge axis.\n\n        @param torque: Torque magnitude\n        @type torque: float\n        ";
static PyObject *__pyx_f_3ode_10HingeJoint_addTorque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_torque = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"torque",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_torque)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_torque);

  /* "/home/zefiris/pyode/src/joints.pyx":441 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_torque); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 441; goto __pyx_L1;}
  dJointAddHingeTorque(((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.HingeJoint.addTorque");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_torque);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10HingeJoint_setParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10HingeJoint_setParam[] = "setParam(param, value)\n\n        Set limit/motor parameters for the joint.\n\n        param is one of ParamLoStop, ParamHiStop, ParamVel, ParamFMax,\n        ParamFudgeFactor, ParamBounce, ParamCFM, ParamStopERP, ParamStopCFM,\n        ParamSuspensionERP, ParamSuspensionCFM.\n\n        These parameter names can be optionally followed by a digit (2\n        or 3) to indicate the second or third set of parameters.\n\n        @param param: Selects the parameter to set\n        @param value: Parameter value \n        @type param: int\n        @type value: float\n        ";
static PyObject *__pyx_f_3ode_10HingeJoint_setParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"param","value",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_param, &__pyx_v_value)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);
  Py_INCREF(__pyx_v_value);

  /* "/home/zefiris/pyode/src/joints.pyx":462 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 462; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 462; goto __pyx_L1;}
  dJointSetHingeParam(((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.HingeJoint.setParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10HingeJoint_getParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10HingeJoint_getParam[] = "getParam(param) -> float\n\n        Get limit/motor parameters for the joint.\n\n        param is one of ParamLoStop, ParamHiStop, ParamVel, ParamFMax,\n        ParamFudgeFactor, ParamBounce, ParamCFM, ParamStopERP, ParamStopCFM,\n        ParamSuspensionERP, ParamSuspensionCFM.\n\n        These parameter names can be optionally followed by a digit (2\n        or 3) to indicate the second or third set of parameters.\n\n        @param param: Selects the parameter to read\n        @type param: int        \n        ";
static PyObject *__pyx_f_3ode_10HingeJoint_getParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  static char *__pyx_argnames[] = {"param",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_param)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);

  /* "/home/zefiris/pyode/src/joints.pyx":480 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 480; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble(dJointGetHingeParam(((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 480; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.HingeJoint.getParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  return __pyx_r;
}

static int __pyx_f_3ode_11SliderJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_11SliderJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  struct __pyx_obj_3ode_JointGroup *__pyx_v_jg;
  dJointGroupID __pyx_v_jgid;
  int __pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k9;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)Py_None); Py_INCREF(Py_None);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 492; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":496 */
  __pyx_v_jgid = NULL;

  /* "/home/zefiris/pyode/src/joints.pyx":497 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 497; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":498 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 498; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)__pyx_v_jointgroup);

    /* "/home/zefiris/pyode/src/joints.pyx":499 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/joints.pyx":500 */
  ((struct __pyx_obj_3ode_SliderJoint *)__pyx_v_self)->__pyx_base.jid = dJointCreateSlider(__pyx_v_world->wid,__pyx_v_jgid);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.SliderJoint.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static int __pyx_f_3ode_11SliderJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_11SliderJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k10;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 502; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":503 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_3ode_SliderJoint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_3ode_SliderJoint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

  /* "/home/zefiris/pyode/src/joints.pyx":504 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 504; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":505 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 505; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 505; goto __pyx_L1;}
    Py_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 505; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.SliderJoint.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11SliderJoint_setAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11SliderJoint_setAxis[] = "setAxis(axis)\n\n        Set the slider axis parameter.\n\n        @param axis: Slider axis\n        @type axis: 3-sequence of floats        \n        ";
static PyObject *__pyx_f_3ode_11SliderJoint_setAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_axis = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"axis",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_axis)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_axis);

  /* "/home/zefiris/pyode/src/joints.pyx":516 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 516; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 516; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 516; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 516; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 516; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 516; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 516; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 516; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 516; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetSliderAxis(((struct __pyx_obj_3ode_SliderJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.SliderJoint.setAxis");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_axis);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11SliderJoint_getAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11SliderJoint_getAxis[] = "getAxis() -> 3-tuple of floats\n\n        Get the slider axis parameter.\n        ";
static PyObject *__pyx_f_3ode_11SliderJoint_getAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":525 */
  dJointGetSliderAxis(((struct __pyx_obj_3ode_SliderJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

  /* "/home/zefiris/pyode/src/joints.pyx":526 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 526; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 526; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 526; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 526; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.SliderJoint.getAxis");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11SliderJoint_getPosition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11SliderJoint_getPosition[] = "getPosition() -> float\n\n        Get the slider linear position (i.e. the slider\'s \"extension\").\n\n        When the axis is set, the current position of the attached\n        bodies is examined and that position will be the zero\n        position.\n        ";
static PyObject *__pyx_f_3ode_11SliderJoint_getPosition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":539 */
  __pyx_1 = PyFloat_FromDouble(dJointGetSliderPosition(((struct __pyx_obj_3ode_SliderJoint *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 539; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.SliderJoint.getPosition");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11SliderJoint_getPositionRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11SliderJoint_getPositionRate[] = "getPositionRate() -> float\n\n        Get the time derivative of the position.\n        ";
static PyObject *__pyx_f_3ode_11SliderJoint_getPositionRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":547 */
  __pyx_1 = PyFloat_FromDouble(dJointGetSliderPositionRate(((struct __pyx_obj_3ode_SliderJoint *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 547; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.SliderJoint.getPositionRate");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11SliderJoint_addForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11SliderJoint_addForce[] = "addForce(force)\n\n        Applies the given force in the slider\'s direction.\n\n        @param force: Force magnitude\n        @type force: float\n        ";
static PyObject *__pyx_f_3ode_11SliderJoint_addForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_force = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"force",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_force)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_force);

  /* "/home/zefiris/pyode/src/joints.pyx":558 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_force); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 558; goto __pyx_L1;}
  dJointAddSliderForce(((struct __pyx_obj_3ode_SliderJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.SliderJoint.addForce");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_force);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11SliderJoint_setParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_11SliderJoint_setParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"param","value",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_param, &__pyx_v_value)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);
  Py_INCREF(__pyx_v_value);

  /* "/home/zefiris/pyode/src/joints.pyx":562 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 562; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 562; goto __pyx_L1;}
  dJointSetSliderParam(((struct __pyx_obj_3ode_SliderJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.SliderJoint.setParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11SliderJoint_getParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_11SliderJoint_getParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  static char *__pyx_argnames[] = {"param",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_param)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);

  /* "/home/zefiris/pyode/src/joints.pyx":566 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 566; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble(dJointGetSliderParam(((struct __pyx_obj_3ode_SliderJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 566; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.SliderJoint.getParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  return __pyx_r;
}

static int __pyx_f_3ode_14UniversalJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_14UniversalJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  struct __pyx_obj_3ode_JointGroup *__pyx_v_jg;
  dJointGroupID __pyx_v_jgid;
  int __pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k11;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)Py_None); Py_INCREF(Py_None);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 578; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":582 */
  __pyx_v_jgid = NULL;

  /* "/home/zefiris/pyode/src/joints.pyx":583 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 583; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":584 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 584; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)__pyx_v_jointgroup);

    /* "/home/zefiris/pyode/src/joints.pyx":585 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/joints.pyx":586 */
  ((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid = dJointCreateUniversal(__pyx_v_world->wid,__pyx_v_jgid);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.UniversalJoint.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static int __pyx_f_3ode_14UniversalJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_14UniversalJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k12;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 588; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":589 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

  /* "/home/zefiris/pyode/src/joints.pyx":590 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 590; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":591 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 591; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.UniversalJoint.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_14UniversalJoint_setAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_14UniversalJoint_setAnchor[] = "setAnchor(pos)\n\n        Set the universal anchor.\n\n        @param pos: Anchor position\n        @type pos: 3-sequence of floats         \n        ";
static PyObject *__pyx_f_3ode_14UniversalJoint_setAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"pos",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pos)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_pos);

  /* "/home/zefiris/pyode/src/joints.pyx":602 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 602; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 602; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 602; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 602; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 602; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 602; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 602; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 602; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 602; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetUniversalAnchor(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.UniversalJoint.setAnchor");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_pos);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_14UniversalJoint_getAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_14UniversalJoint_getAnchor[] = "getAnchor() -> 3-tuple of floats\n\n        Get the joint anchor point, in world coordinates. This returns\n        the point on body 1. If the joint is perfectly satisfied, this\n        will be the same as the point on body 2.\n        ";
static PyObject *__pyx_f_3ode_14UniversalJoint_getAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":614 */
  dJointGetUniversalAnchor(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/zefiris/pyode/src/joints.pyx":615 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 615; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 615; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 615; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 615; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.UniversalJoint.getAnchor");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_14UniversalJoint_getAnchor2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_14UniversalJoint_getAnchor2[] = "getAnchor2() -> 3-tuple of floats\n\n        Get the joint anchor point, in world coordinates. This returns\n        the point on body 2. If the joint is perfectly satisfied, this\n        will be the same as the point on body 1.\n        ";
static PyObject *__pyx_f_3ode_14UniversalJoint_getAnchor2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":627 */
  dJointGetUniversalAnchor2(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/zefiris/pyode/src/joints.pyx":628 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 628; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 628; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 628; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 628; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.UniversalJoint.getAnchor2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_14UniversalJoint_setAxis1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_14UniversalJoint_setAxis1[] = "setAxis1(axis)\n\n        Set the first universal axis. Axis 1 and axis 2 should be\n        perpendicular to each other.\n\n        @param axis: Joint axis\n        @type axis: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_14UniversalJoint_setAxis1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_axis = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"axis",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_axis)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_axis);

  /* "/home/zefiris/pyode/src/joints.pyx":640 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetUniversalAxis1(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.UniversalJoint.setAxis1");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_axis);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_14UniversalJoint_getAxis1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_14UniversalJoint_getAxis1[] = "getAxis1() -> 3-tuple of floats\n\n        Get the first univeral axis.\n        ";
static PyObject *__pyx_f_3ode_14UniversalJoint_getAxis1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":649 */
  dJointGetUniversalAxis1(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

  /* "/home/zefiris/pyode/src/joints.pyx":650 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 650; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 650; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 650; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 650; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.UniversalJoint.getAxis1");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_14UniversalJoint_setAxis2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_14UniversalJoint_setAxis2[] = "setAxis2(axis)\n\n        Set the second universal axis. Axis 1 and axis 2 should be\n        perpendicular to each other.\n\n        @param axis: Joint axis\n        @type axis: 3-sequence of floats        \n        ";
static PyObject *__pyx_f_3ode_14UniversalJoint_setAxis2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_axis = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"axis",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_axis)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_axis);

  /* "/home/zefiris/pyode/src/joints.pyx":662 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 662; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 662; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 662; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 662; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 662; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 662; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 662; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 662; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 662; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetUniversalAxis2(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.UniversalJoint.setAxis2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_axis);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_14UniversalJoint_getAxis2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_14UniversalJoint_getAxis2[] = "getAxis2() -> 3-tuple of floats\n\n        Get the second univeral axis.\n        ";
static PyObject *__pyx_f_3ode_14UniversalJoint_getAxis2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":671 */
  dJointGetUniversalAxis2(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

  /* "/home/zefiris/pyode/src/joints.pyx":672 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 672; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 672; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 672; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 672; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.UniversalJoint.getAxis2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_14UniversalJoint_addTorques(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_14UniversalJoint_addTorques[] = "addTorques(torque1, torque2)\n\n        Applies torque1 about axis 1, and torque2 about axis 2.\n\n        @param torque1: Torque 1 magnitude\n        @param torque2: Torque 2 magnitude\n        @type torque1: float\n        @type torque2: float\n        ";
static PyObject *__pyx_f_3ode_14UniversalJoint_addTorques(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_torque1 = 0;
  PyObject *__pyx_v_torque2 = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"torque1","torque2",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_torque1, &__pyx_v_torque2)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_torque1);
  Py_INCREF(__pyx_v_torque2);

  /* "/home/zefiris/pyode/src/joints.pyx":685 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_torque1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 685; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_torque2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 685; goto __pyx_L1;}
  dJointAddUniversalTorques(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.UniversalJoint.addTorques");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_torque1);
  Py_DECREF(__pyx_v_torque2);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_14UniversalJoint_setParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_14UniversalJoint_setParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"param","value",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_param, &__pyx_v_value)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);
  Py_INCREF(__pyx_v_value);

  /* "/home/zefiris/pyode/src/joints.pyx":689 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 689; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 689; goto __pyx_L1;}
  dJointSetUniversalParam(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.UniversalJoint.setParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_14UniversalJoint_getParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_14UniversalJoint_getParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  static char *__pyx_argnames[] = {"param",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_param)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);

  /* "/home/zefiris/pyode/src/joints.pyx":693 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 693; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble(dJointGetUniversalParam(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 693; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.UniversalJoint.getParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  return __pyx_r;
}

static int __pyx_f_3ode_11Hinge2Joint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_11Hinge2Joint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  struct __pyx_obj_3ode_JointGroup *__pyx_v_jg;
  dJointGroupID __pyx_v_jgid;
  int __pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k13;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)Py_None); Py_INCREF(Py_None);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 705; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":709 */
  __pyx_v_jgid = NULL;

  /* "/home/zefiris/pyode/src/joints.pyx":710 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 710; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":711 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 711; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)__pyx_v_jointgroup);

    /* "/home/zefiris/pyode/src/joints.pyx":712 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/joints.pyx":713 */
  ((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid = dJointCreateHinge2(__pyx_v_world->wid,__pyx_v_jgid);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Hinge2Joint.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static int __pyx_f_3ode_11Hinge2Joint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_11Hinge2Joint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k14;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 1, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 715; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":716 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

  /* "/home/zefiris/pyode/src/joints.pyx":717 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 717; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":718 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 718; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 718; goto __pyx_L1;}
    Py_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 718; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Hinge2Joint.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11Hinge2Joint_setAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11Hinge2Joint_setAnchor[] = "setAnchor(pos)\n\n        Set the hinge-2 anchor.\n\n        @param pos: Anchor position\n        @type pos: 3-sequence of floats        \n        ";
static PyObject *__pyx_f_3ode_11Hinge2Joint_setAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"pos",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pos)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_pos);

  /* "/home/zefiris/pyode/src/joints.pyx":729 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 729; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 729; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 729; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 729; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 729; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 729; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 729; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 729; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 729; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetHinge2Anchor(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Hinge2Joint.setAnchor");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_pos);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11Hinge2Joint_getAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11Hinge2Joint_getAnchor[] = "getAnchor() -> 3-tuple of floats\n\n        Get the joint anchor point, in world coordinates. This returns\n        the point on body 1. If the joint is perfectly satisfied, this\n        will be the same as the point on body 2.\n        ";
static PyObject *__pyx_f_3ode_11Hinge2Joint_getAnchor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":741 */
  dJointGetHinge2Anchor(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/zefiris/pyode/src/joints.pyx":742 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 742; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 742; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 742; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 742; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Hinge2Joint.getAnchor");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11Hinge2Joint_getAnchor2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11Hinge2Joint_getAnchor2[] = "getAnchor2() -> 3-tuple of floats\n\n        Get the joint anchor point, in world coordinates. This returns\n        the point on body 2. If the joint is perfectly satisfied, this\n        will be the same as the point on body 1.\n        ";
static PyObject *__pyx_f_3ode_11Hinge2Joint_getAnchor2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":754 */
  dJointGetHinge2Anchor2(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/zefiris/pyode/src/joints.pyx":755 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 755; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 755; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 755; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 755; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Hinge2Joint.getAnchor2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11Hinge2Joint_setAxis1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11Hinge2Joint_setAxis1[] = "setAxis1(axis)\n\n        Set the first hinge-2 axis. Axis 1 and axis 2 must not lie\n        along the same line.\n\n        @param axis: Joint axis\n        @type axis: 3-sequence of floats        \n        ";
static PyObject *__pyx_f_3ode_11Hinge2Joint_setAxis1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_axis = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"axis",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_axis)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_axis);

  /* "/home/zefiris/pyode/src/joints.pyx":768 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetHinge2Axis1(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Hinge2Joint.setAxis1");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_axis);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11Hinge2Joint_getAxis1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11Hinge2Joint_getAxis1[] = "getAxis1() -> 3-tuple of floats\n\n        Get the first hinge-2 axis.\n        ";
static PyObject *__pyx_f_3ode_11Hinge2Joint_getAxis1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":777 */
  dJointGetHinge2Axis1(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

  /* "/home/zefiris/pyode/src/joints.pyx":778 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 778; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 778; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 778; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 778; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Hinge2Joint.getAxis1");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11Hinge2Joint_setAxis2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11Hinge2Joint_setAxis2[] = "setAxis2(axis)\n\n        Set the second hinge-2 axis. Axis 1 and axis 2 must not lie\n        along the same line.\n\n        @param axis: Joint axis\n        @type axis: 3-sequence of floats        \n        ";
static PyObject *__pyx_f_3ode_11Hinge2Joint_setAxis2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_axis = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"axis",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_axis)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_axis);

  /* "/home/zefiris/pyode/src/joints.pyx":790 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 790; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 790; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 790; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 790; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 790; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 790; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 790; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 790; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 790; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetHinge2Axis2(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Hinge2Joint.setAxis2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_axis);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11Hinge2Joint_getAxis2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11Hinge2Joint_getAxis2[] = "getAxis2() -> 3-tuple of floats\n\n        Get the second hinge-2 axis.\n        ";
static PyObject *__pyx_f_3ode_11Hinge2Joint_getAxis2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":799 */
  dJointGetHinge2Axis2(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

  /* "/home/zefiris/pyode/src/joints.pyx":800 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Hinge2Joint.getAxis2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11Hinge2Joint_getAngle1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11Hinge2Joint_getAngle1[] = "getAngle1() -> float\n\n        Get the first hinge-2 angle (around axis 1).\n\n        When the anchor or axis is set, the current position of the\n        attached bodies is examined and that position will be the zero\n        angle.\n        ";
static PyObject *__pyx_f_3ode_11Hinge2Joint_getAngle1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":812 */
  __pyx_1 = PyFloat_FromDouble(dJointGetHinge2Angle1(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 812; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Hinge2Joint.getAngle1");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11Hinge2Joint_getAngle1Rate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11Hinge2Joint_getAngle1Rate[] = "getAngle1Rate() -> float\n\n        Get the time derivative of the first hinge-2 angle.\n        ";
static PyObject *__pyx_f_3ode_11Hinge2Joint_getAngle1Rate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":820 */
  __pyx_1 = PyFloat_FromDouble(dJointGetHinge2Angle1Rate(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 820; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Hinge2Joint.getAngle1Rate");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11Hinge2Joint_getAngle2Rate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11Hinge2Joint_getAngle2Rate[] = "getAngle2Rate() -> float\n\n        Get the time derivative of the second hinge-2 angle.\n        ";
static PyObject *__pyx_f_3ode_11Hinge2Joint_getAngle2Rate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":828 */
  __pyx_1 = PyFloat_FromDouble(dJointGetHinge2Angle2Rate(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 828; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.Hinge2Joint.getAngle2Rate");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11Hinge2Joint_addTorques(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11Hinge2Joint_addTorques[] = "addTorques(torque1, torque2)\n\n        Applies torque1 about axis 1, and torque2 about axis 2.\n\n        @param torque1: Torque 1 magnitude\n        @param torque2: Torque 2 magnitude\n        @type torque1: float\n        @type torque2: float\n        ";
static PyObject *__pyx_f_3ode_11Hinge2Joint_addTorques(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_torque1 = 0;
  PyObject *__pyx_v_torque2 = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"torque1","torque2",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_torque1, &__pyx_v_torque2)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_torque1);
  Py_INCREF(__pyx_v_torque2);

  /* "/home/zefiris/pyode/src/joints.pyx":841 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_torque1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 841; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_torque2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 841; goto __pyx_L1;}
  dJointAddHinge2Torques(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Hinge2Joint.addTorques");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_torque1);
  Py_DECREF(__pyx_v_torque2);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11Hinge2Joint_setParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_11Hinge2Joint_setParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"param","value",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_param, &__pyx_v_value)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);
  Py_INCREF(__pyx_v_value);

  /* "/home/zefiris/pyode/src/joints.pyx":845 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 845; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 845; goto __pyx_L1;}
  dJointSetHinge2Param(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Hinge2Joint.setParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11Hinge2Joint_getParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_11Hinge2Joint_getParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  static char *__pyx_argnames[] = {"param",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_param)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);

  /* "/home/zefiris/pyode/src/joints.pyx":849 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 849; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble(dJointGetHinge2Param(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 849; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.Hinge2Joint.getParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  return __pyx_r;
}

static int __pyx_f_3ode_10FixedJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_10FixedJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  struct __pyx_obj_3ode_JointGroup *__pyx_v_jg;
  dJointGroupID __pyx_v_jgid;
  int __pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k15;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)Py_None); Py_INCREF(Py_None);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 861; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":865 */
  __pyx_v_jgid = NULL;

  /* "/home/zefiris/pyode/src/joints.pyx":866 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 866; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":867 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 867; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)__pyx_v_jointgroup);

    /* "/home/zefiris/pyode/src/joints.pyx":868 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/joints.pyx":869 */
  ((struct __pyx_obj_3ode_FixedJoint *)__pyx_v_self)->__pyx_base.jid = dJointCreateFixed(__pyx_v_world->wid,__pyx_v_jgid);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.FixedJoint.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static int __pyx_f_3ode_10FixedJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_10FixedJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k16;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 871; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":872 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_3ode_FixedJoint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_3ode_FixedJoint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

  /* "/home/zefiris/pyode/src/joints.pyx":873 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 873; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":874 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 874; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 874; goto __pyx_L1;}
    Py_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 874; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.FixedJoint.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10FixedJoint_setFixed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10FixedJoint_setFixed[] = "setFixed()\n\n        Call this on the fixed joint after it has been attached to\n        remember the current desired relative offset and desired\n        relative rotation between the bodies.\n        ";
static PyObject *__pyx_f_3ode_10FixedJoint_setFixed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":884 */
  dJointSetFixed(((struct __pyx_obj_3ode_FixedJoint *)__pyx_v_self)->__pyx_base.jid);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_3ode_12ContactJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_12ContactJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  struct __pyx_obj_3ode_Contact *__pyx_v_contact = 0;
  struct __pyx_obj_3ode_JointGroup *__pyx_v_jg;
  dJointGroupID __pyx_v_jgid;
  int __pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"world","jointgroup","contact",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup, &__pyx_v_contact)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  Py_INCREF(__pyx_v_contact);
  __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)Py_None); Py_INCREF(Py_None);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 896; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_contact), __pyx_ptype_3ode_Contact, 1, "contact")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 896; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":899 */
  __pyx_v_jgid = NULL;

  /* "/home/zefiris/pyode/src/joints.pyx":900 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 900; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":901 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 901; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)__pyx_v_jointgroup);

    /* "/home/zefiris/pyode/src/joints.pyx":902 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/joints.pyx":903 */
  ((struct __pyx_obj_3ode_ContactJoint *)__pyx_v_self)->__pyx_base.jid = dJointCreateContact(__pyx_v_world->wid,__pyx_v_jgid,(&__pyx_v_contact->_contact));

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.ContactJoint.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  Py_DECREF(__pyx_v_contact);
  return __pyx_r;
}

static int __pyx_f_3ode_12ContactJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_12ContactJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  struct __pyx_obj_3ode_Contact *__pyx_v_contact = 0;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"world","jointgroup","contact",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup, &__pyx_v_contact)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  Py_INCREF(__pyx_v_contact);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 905; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_contact), __pyx_ptype_3ode_Contact, 1, "contact")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 905; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":906 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_3ode_ContactJoint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_3ode_ContactJoint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

  /* "/home/zefiris/pyode/src/joints.pyx":907 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 907; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":908 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 908; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 908; goto __pyx_L1;}
    Py_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 908; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.ContactJoint.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  Py_DECREF(__pyx_v_contact);
  return __pyx_r;
}

static int __pyx_f_3ode_6AMotor___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_6AMotor___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  struct __pyx_obj_3ode_JointGroup *__pyx_v_jg;
  dJointGroupID __pyx_v_jgid;
  int __pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k17;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)Py_None); Py_INCREF(Py_None);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 919; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":923 */
  __pyx_v_jgid = NULL;

  /* "/home/zefiris/pyode/src/joints.pyx":924 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 924; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":925 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 925; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)__pyx_v_jointgroup);

    /* "/home/zefiris/pyode/src/joints.pyx":926 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/joints.pyx":927 */
  ((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid = dJointCreateAMotor(__pyx_v_world->wid,__pyx_v_jgid);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.AMotor.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static int __pyx_f_3ode_6AMotor___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_6AMotor___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k18;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 929; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":930 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

  /* "/home/zefiris/pyode/src/joints.pyx":931 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 931; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":932 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 932; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 932; goto __pyx_L1;}
    Py_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 932; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.AMotor.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6AMotor_setMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6AMotor_setMode[] = "setMode(mode)\n\n        Set the angular motor mode.  mode must be either AMotorUser or\n        AMotorEuler.\n\n        @param mode: Angular motor mode\n        @type mode: int\n        ";
static PyObject *__pyx_f_3ode_6AMotor_setMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"mode",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_mode)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_mode);

  /* "/home/zefiris/pyode/src/joints.pyx":944 */
  __pyx_1 = PyInt_AsLong(__pyx_v_mode); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 944; goto __pyx_L1;}
  dJointSetAMotorMode(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.AMotor.setMode");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_mode);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6AMotor_getMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6AMotor_getMode[] = "getMode()\n\n        Return the angular motor mode (AMotorUser or AMotorEuler).\n        ";
static PyObject *__pyx_f_3ode_6AMotor_getMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":952 */
  __pyx_1 = PyInt_FromLong(dJointGetAMotorMode(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 952; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.AMotor.getMode");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6AMotor_setNumAxes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6AMotor_setNumAxes[] = "setNumAxes(num)\n\n        Set the number of angular axes that will be controlled by the AMotor.\n        num may be in the range from 0 to 3.\n\n        @param num: Number of axes (0-3)\n        @type num: int\n        ";
static PyObject *__pyx_f_3ode_6AMotor_setNumAxes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_num;
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {"num",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_num)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":964 */
  dJointSetAMotorNumAxes(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_num);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6AMotor_getNumAxes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6AMotor_getNumAxes[] = "getNumAxes() -> int\n\n        Get the number of angular axes that are controlled by the AMotor.\n        ";
static PyObject *__pyx_f_3ode_6AMotor_getNumAxes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":972 */
  __pyx_1 = PyInt_FromLong(dJointGetAMotorNumAxes(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 972; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.AMotor.getNumAxes");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6AMotor_setAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6AMotor_setAxis[] = "setAxis(anum, rel, axis)\n\n        Set an AMotor axis.\n\n        The anum argument selects the axis to change (0,1 or 2).\n        Each axis can have one of three \"relative orientation\" modes,\n        selected by rel:\n        \n        0: The axis is anchored to the global frame. \n        1: The axis is anchored to the first body. \n        2: The axis is anchored to the second body.\n\n        The axis vector is always specified in global coordinates\n        regardless of the setting of rel.\n\n        @param anum: Axis number\n        @param rel: Relative orientation mode\n        @param axis: Axis\n        @type anum: int\n        @type rel: int\n        @type axis: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_6AMotor_setAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_anum;
  int __pyx_v_rel;
  PyObject *__pyx_v_axis = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"anum","rel","axis",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "iiO", __pyx_argnames, &__pyx_v_anum, &__pyx_v_rel, &__pyx_v_axis)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_axis);

  /* "/home/zefiris/pyode/src/joints.pyx":998 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 998; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 998; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 998; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 998; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 998; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 998; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 998; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 998; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 998; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetAMotorAxis(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_anum,__pyx_v_rel,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.AMotor.setAxis");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_axis);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6AMotor_getAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6AMotor_getAxis[] = "getAxis(anum)\n\n        Get an AMotor axis.\n\n        @param anum: Axis index (0-2)\n        @type anum: int        \n        ";
static PyObject *__pyx_f_3ode_6AMotor_getAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_anum;
  dVector3 __pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"anum",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_anum)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":1010 */
  dJointGetAMotorAxis(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_anum,__pyx_v_a);

  /* "/home/zefiris/pyode/src/joints.pyx":1011 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1011; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1011; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1011; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1011; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.AMotor.getAxis");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6AMotor_getAxisRel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6AMotor_getAxisRel[] = "getAxisRel(anum) -> int\n\n        Get the relative mode of an axis.\n\n        @param anum: Axis index (0-2)\n        @type anum: int        \n        ";
static PyObject *__pyx_f_3ode_6AMotor_getAxisRel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_anum;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {"anum",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_anum)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":1022 */
  __pyx_1 = PyInt_FromLong(dJointGetAMotorAxisRel(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_anum)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1022; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.AMotor.getAxisRel");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6AMotor_setAngle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6AMotor_setAngle[] = "setAngle(anum, angle)\n\n        Tell the AMotor what the current angle is along axis anum.\n\n        @param anum: Axis index\n        @param angle: Angle\n        @type anum: int\n        @type angle: float\n        ";
static PyObject *__pyx_f_3ode_6AMotor_setAngle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_anum;
  PyObject *__pyx_v_angle = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"anum","angle",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "iO", __pyx_argnames, &__pyx_v_anum, &__pyx_v_angle)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_angle);

  /* "/home/zefiris/pyode/src/joints.pyx":1035 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_angle); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1035; goto __pyx_L1;}
  dJointSetAMotorAngle(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_anum,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.AMotor.setAngle");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_angle);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6AMotor_getAngle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6AMotor_getAngle[] = "getAngle(anum) -> float\n\n        Return the current angle for axis anum.\n\n        @param anum: Axis index\n        @type anum: int        \n        ";
static PyObject *__pyx_f_3ode_6AMotor_getAngle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_anum;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {"anum",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_anum)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":1046 */
  __pyx_1 = PyFloat_FromDouble(dJointGetAMotorAngle(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_anum)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1046; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.AMotor.getAngle");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6AMotor_getAngleRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6AMotor_getAngleRate[] = "getAngleRate(anum) -> float\n\n        Return the current angle rate for axis anum.\n\n        @param anum: Axis index\n        @type anum: int        \n        ";
static PyObject *__pyx_f_3ode_6AMotor_getAngleRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_anum;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {"anum",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_anum)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":1057 */
  __pyx_1 = PyFloat_FromDouble(dJointGetAMotorAngleRate(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_anum)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1057; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.AMotor.getAngleRate");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6AMotor_addTorques(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6AMotor_addTorques[] = "addTorques(torque0, torque1, torque2)\n\n        Applies torques about the AMotor\'s axes.\n\n        @param torque0: Torque 0 magnitude\n        @param torque1: Torque 1 magnitude\n        @param torque2: Torque 2 magnitude\n        @type torque0: float\n        @type torque1: float\n        @type torque2: float\n        ";
static PyObject *__pyx_f_3ode_6AMotor_addTorques(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_torque0 = 0;
  PyObject *__pyx_v_torque1 = 0;
  PyObject *__pyx_v_torque2 = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  dReal __pyx_2;
  dReal __pyx_3;
  static char *__pyx_argnames[] = {"torque0","torque1","torque2",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_torque0, &__pyx_v_torque1, &__pyx_v_torque2)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_torque0);
  Py_INCREF(__pyx_v_torque1);
  Py_INCREF(__pyx_v_torque2);

  /* "/home/zefiris/pyode/src/joints.pyx":1072 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_torque0); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1072; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_torque1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1072; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_torque2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1072; goto __pyx_L1;}
  dJointAddAMotorTorques(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_1,__pyx_2,__pyx_3);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.AMotor.addTorques");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_torque0);
  Py_DECREF(__pyx_v_torque1);
  Py_DECREF(__pyx_v_torque2);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6AMotor_setParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_6AMotor_setParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"param","value",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_param, &__pyx_v_value)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);
  Py_INCREF(__pyx_v_value);

  /* "/home/zefiris/pyode/src/joints.pyx":1076 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1076; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1076; goto __pyx_L1;}
  dJointSetAMotorParam(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.AMotor.setParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6AMotor_getParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_6AMotor_getParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  static char *__pyx_argnames[] = {"param",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_param)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);

  /* "/home/zefiris/pyode/src/joints.pyx":1080 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1080; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble(dJointGetAMotorParam(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1080; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.AMotor.getParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  return __pyx_r;
}

static int __pyx_f_3ode_6LMotor___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_6LMotor___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  struct __pyx_obj_3ode_JointGroup *__pyx_v_jg;
  dJointGroupID __pyx_v_jgid;
  int __pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k19;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)Py_None); Py_INCREF(Py_None);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1092; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":1096 */
  __pyx_v_jgid = NULL;

  /* "/home/zefiris/pyode/src/joints.pyx":1097 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1097; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":1098 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1098; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)__pyx_v_jointgroup);

    /* "/home/zefiris/pyode/src/joints.pyx":1099 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/joints.pyx":1100 */
  ((struct __pyx_obj_3ode_LMotor *)__pyx_v_self)->__pyx_base.jid = dJointCreateLMotor(__pyx_v_world->wid,__pyx_v_jgid);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.LMotor.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static int __pyx_f_3ode_6LMotor___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_6LMotor___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k20;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1102; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":1103 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_3ode_LMotor *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_3ode_LMotor *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

  /* "/home/zefiris/pyode/src/joints.pyx":1104 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1104; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":1105 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1105; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1105; goto __pyx_L1;}
    Py_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1105; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.LMotor.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6LMotor_setNumAxes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6LMotor_setNumAxes[] = "setNumAxes(num)\n\n        Set the number of angular axes that will be controlled by the LMotor.\n        num may be in the range from 0 to 3.\n\n        @param num: Number of axes (0-3)\n        @type num: int\n        ";
static PyObject *__pyx_f_3ode_6LMotor_setNumAxes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_num;
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {"num",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_num)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":1117 */
  dJointSetLMotorNumAxes(((struct __pyx_obj_3ode_LMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_num);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6LMotor_getNumAxes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6LMotor_getNumAxes[] = "getNumAxes() -> int\n\n        Get the number of angular axes that are controlled by the LMotor.\n        ";
static PyObject *__pyx_f_3ode_6LMotor_getNumAxes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":1125 */
  __pyx_1 = PyInt_FromLong(dJointGetLMotorNumAxes(((struct __pyx_obj_3ode_LMotor *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1125; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.LMotor.getNumAxes");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6LMotor_setAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6LMotor_setAxis[] = "setAxis(anum, rel, axis)\n\n        Set an LMotor axis.\n\n        The anum argument selects the axis to change (0,1 or 2).\n        Each axis can have one of three \"relative orientation\" modes,\n        selected by rel:\n\n        0: The axis is anchored to the global frame. \n        1: The axis is anchored to the first body. \n        2: The axis is anchored to the second body.\n\n        @param anum: Axis number\n        @param rel: Relative orientation mode\n        @param axis: Axis\n        @type anum: int\n        @type rel: int\n        @type axis: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_6LMotor_setAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_anum;
  int __pyx_v_rel;
  PyObject *__pyx_v_axis = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"anum","rel","axis",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "iiO", __pyx_argnames, &__pyx_v_anum, &__pyx_v_rel, &__pyx_v_axis)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_axis);

  /* "/home/zefiris/pyode/src/joints.pyx":1148 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1148; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1148; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1148; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1148; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1148; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1148; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1148; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1148; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1148; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetLMotorAxis(((struct __pyx_obj_3ode_LMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_anum,__pyx_v_rel,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.LMotor.setAxis");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_axis);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6LMotor_getAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_6LMotor_getAxis[] = "getAxis(anum)\n\n        Get an LMotor axis.\n\n        @param anum: Axis index (0-2)\n        @type anum: int        \n        ";
static PyObject *__pyx_f_3ode_6LMotor_getAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_anum;
  dVector3 __pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"anum",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_anum)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/joints.pyx":1160 */
  dJointGetLMotorAxis(((struct __pyx_obj_3ode_LMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_anum,__pyx_v_a);

  /* "/home/zefiris/pyode/src/joints.pyx":1161 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1161; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1161; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1161; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1161; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.LMotor.getAxis");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6LMotor_setParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_6LMotor_setParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"param","value",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_param, &__pyx_v_value)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);
  Py_INCREF(__pyx_v_value);

  /* "/home/zefiris/pyode/src/joints.pyx":1165 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1165; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1165; goto __pyx_L1;}
  dJointSetLMotorParam(((struct __pyx_obj_3ode_LMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.LMotor.setParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_6LMotor_getParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_6LMotor_getParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  static char *__pyx_argnames[] = {"param",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_param)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);

  /* "/home/zefiris/pyode/src/joints.pyx":1169 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1169; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble(dJointGetLMotorParam(((struct __pyx_obj_3ode_LMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1169; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.LMotor.getParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  return __pyx_r;
}

static int __pyx_f_3ode_12Plane2DJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_12Plane2DJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  struct __pyx_obj_3ode_JointGroup *__pyx_v_jg;
  dJointGroupID __pyx_v_jgid;
  int __pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k21;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)Py_None); Py_INCREF(Py_None);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1181; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":1185 */
  __pyx_v_jgid = NULL;

  /* "/home/zefiris/pyode/src/joints.pyx":1186 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1186; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":1187 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1187; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    __pyx_v_jg = ((struct __pyx_obj_3ode_JointGroup *)__pyx_v_jointgroup);

    /* "/home/zefiris/pyode/src/joints.pyx":1188 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/joints.pyx":1189 */
  ((struct __pyx_obj_3ode_Plane2DJoint *)__pyx_v_self)->__pyx_base.jid = dJointCreatePlane2D(__pyx_v_world->wid,__pyx_v_jgid);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Plane2DJoint.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static int __pyx_f_3ode_12Plane2DJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_12Plane2DJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"world","jointgroup",0};
  __pyx_v_jointgroup = __pyx_k22;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1191; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/joints.pyx":1192 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_3ode_Plane2DJoint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_3ode_Plane2DJoint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

  /* "/home/zefiris/pyode/src/joints.pyx":1193 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1193; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/joints.pyx":1194 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1194; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1194; goto __pyx_L1;}
    Py_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1194; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.Plane2DJoint.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_12Plane2DJoint_setXParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_12Plane2DJoint_setXParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"param","value",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_param, &__pyx_v_value)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);
  Py_INCREF(__pyx_v_value);

  /* "/home/zefiris/pyode/src/joints.pyx":1197 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1197; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1197; goto __pyx_L1;}
  dJointSetPlane2DXParam(((struct __pyx_obj_3ode_Plane2DJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Plane2DJoint.setXParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_12Plane2DJoint_setYParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_12Plane2DJoint_setYParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"param","value",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_param, &__pyx_v_value)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);
  Py_INCREF(__pyx_v_value);

  /* "/home/zefiris/pyode/src/joints.pyx":1200 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1200; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1200; goto __pyx_L1;}
  dJointSetPlane2DYParam(((struct __pyx_obj_3ode_Plane2DJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Plane2DJoint.setYParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_12Plane2DJoint_setAngleParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_12Plane2DJoint_setAngleParam(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"param","value",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_param, &__pyx_v_value)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_param);
  Py_INCREF(__pyx_v_value);

  /* "/home/zefiris/pyode/src/joints.pyx":1203 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1203; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1203; goto __pyx_L1;}
  dJointSetPlane2DAngleParam(((struct __pyx_obj_3ode_Plane2DJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Plane2DJoint.setAngleParam");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_param);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}

static int __pyx_f_3ode_10GeomObject___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_10GeomObject___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_a, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_a);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":56 */
  ((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid = NULL;

  /* "/home/zefiris/pyode/src/geomobject.pyx":57 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->space);
  ((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->space = Py_None;

  /* "/home/zefiris/pyode/src/geomobject.pyx":58 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->body);
  ((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->body = Py_None;

  /* "/home/zefiris/pyode/src/geomobject.pyx":59 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 59; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->attribs);
  ((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->attribs = __pyx_1;
  __pyx_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomObject.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_a);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_self);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static PyObject *__pyx_k85p;

static char (__pyx_k85[]) = "The GeomObject base class can't be used directly.";

static int __pyx_f_3ode_10GeomObject___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_10GeomObject___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_a, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_a);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":62 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k85p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; goto __pyx_L1;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomObject.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_a);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_self);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static void __pyx_f_3ode_10GeomObject___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_f_3ode_10GeomObject___dealloc__(PyObject *__pyx_v_self) {
  int __pyx_1;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":65 */
  __pyx_1 = (((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid != NULL);
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/geomobject.pyx":66 */
    dGeomDestroy(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid);

    /* "/home/zefiris/pyode/src/geomobject.pyx":67 */
    ((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid = NULL;
    goto __pyx_L2;
  }
  __pyx_L2:;

  Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_k86p;

static char (__pyx_k86[]) = "geom has no attribute '%s'.";

static PyObject *__pyx_f_3ode_10GeomObject___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_f_3ode_10GeomObject___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_name);

  /* "/home/zefiris/pyode/src/geomobject.pyx":70 */
  __pyx_1 = PySequence_Contains(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->attribs, __pyx_v_name); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/geomobject.pyx":71 */
    __pyx_2 = PyObject_GetItem(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->attribs, __pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 71; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/zefiris/pyode/src/geomobject.pyx":73 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 73; goto __pyx_L1;}
    __pyx_3 = PyNumber_Remainder(__pyx_k86p, __pyx_v_name); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 73; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 73; goto __pyx_L1;}
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.GeomObject.__getattr__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_name);
  return __pyx_r;
}

static int __pyx_f_3ode_10GeomObject___setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_val); /*proto*/
static int __pyx_f_3ode_10GeomObject___setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_val) {
  int __pyx_r;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_name);
  Py_INCREF(__pyx_v_val);

  /* "/home/zefiris/pyode/src/geomobject.pyx":76 */
  if (PyObject_SetItem(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->attribs, __pyx_v_name, __pyx_v_val) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 76; goto __pyx_L1;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomObject.__setattr__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_name);
  Py_DECREF(__pyx_v_val);
  return __pyx_r;
}

static PyObject *__pyx_k87p;

static char (__pyx_k87[]) = "Bug: The _id() method is not implemented.";

static PyObject *__pyx_f_3ode_10GeomObject__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject__id[] = "_id() -> int\n\n        Return the internal id of the geom (dGeomID) as returned by\n        the dCreateXyz() functions.\n\n        This method has to be overwritten in derived methods.        \n        ";
static PyObject *__pyx_f_3ode_10GeomObject__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":86 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 86; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k87p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[5]; __pyx_lineno = 86; goto __pyx_L1;}

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomObject._id");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomObject_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_placeable[] = "placeable() -> bool\n\n        Returns True if the geom object is a placeable geom.\n\n        This method has to be overwritten in derived methods.\n        ";
static PyObject *__pyx_f_3ode_10GeomObject_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":95 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 95; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomObject.placeable");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_placeable;
static PyObject *__pyx_n_ValueError;

static PyObject *__pyx_k88p;

static char (__pyx_k88[]) = "Non-placeable geoms cannot have a body associated to them.";

static PyObject *__pyx_f_3ode_10GeomObject_setBody(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_setBody[] = "setBody(body)\n\n        Set the body associated with a placeable geom.\n\n        @param body: The Body object or None.\n        @type body: Body\n        ";
static PyObject *__pyx_f_3ode_10GeomObject_setBody(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_Body *__pyx_v_body = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  int __pyx_4;
  static char *__pyx_argnames[] = {"body",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_body)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_body);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_body), __pyx_ptype_3ode_Body, 1, "body")) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 97; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/geomobject.pyx":106 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 106; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 106; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyObject_IsTrue(__pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 106; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = (!__pyx_3);
  if (__pyx_4) {

    /* "/home/zefiris/pyode/src/geomobject.pyx":107 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 107; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k88p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 107; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geomobject.pyx":109 */
  if (PyObject_Cmp(((PyObject *)__pyx_v_body), Py_None, &__pyx_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 109; goto __pyx_L1;}
  __pyx_3 = __pyx_3 == 0;
  if (__pyx_3) {

    /* "/home/zefiris/pyode/src/geomobject.pyx":110 */
    dGeomSetBody(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,NULL);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/zefiris/pyode/src/geomobject.pyx":112 */
    dGeomSetBody(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,__pyx_v_body->bid);
  }
  __pyx_L3:;

  /* "/home/zefiris/pyode/src/geomobject.pyx":113 */
  Py_INCREF(((PyObject *)__pyx_v_body));
  Py_DECREF(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->body);
  ((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->body = ((PyObject *)__pyx_v_body);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.GeomObject.setBody");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_body);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomObject_getBody(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_getBody[] = "getBody() -> Body\n\n        Get the body associated with this geom.\n        ";
static PyObject *__pyx_f_3ode_10GeomObject_getBody(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  int __pyx_4;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":120 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 120; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 120; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyObject_IsTrue(__pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 120; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = (!__pyx_3);
  if (__pyx_4) {

    /* "/home/zefiris/pyode/src/geomobject.pyx":121 */
    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_environment); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 121; goto __pyx_L1;}
    __pyx_r = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geomobject.pyx":123 */
  Py_INCREF(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->body);
  __pyx_r = ((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->body;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.GeomObject.getBody");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_k89p;

static char (__pyx_k89[]) = "Cannot set a position on non-placeable geoms.";

static PyObject *__pyx_f_3ode_10GeomObject_setPosition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_setPosition[] = "setPosition(pos)\n\n        Set the position of the geom. If the geom is attached to a body,\n        the body\'s position will also be changed.\n\n        @param pos: Position\n        @type pos: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_10GeomObject_setPosition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  int __pyx_4;
  dReal __pyx_5;
  dReal __pyx_6;
  dReal __pyx_7;
  static char *__pyx_argnames[] = {"pos",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pos)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_pos);

  /* "/home/zefiris/pyode/src/geomobject.pyx":134 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 134; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 134; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyObject_IsTrue(__pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 134; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = (!__pyx_3);
  if (__pyx_4) {

    /* "/home/zefiris/pyode/src/geomobject.pyx":135 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 135; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k89p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 135; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geomobject.pyx":136 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 136; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_pos, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 136; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 136; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 136; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_pos, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 136; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 136; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_2 = PyInt_FromLong(2); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 136; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_pos, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 136; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_7 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 136; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  dGeomSetPosition(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,__pyx_5,__pyx_6,__pyx_7);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.GeomObject.setPosition");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_pos);
  return __pyx_r;
}

static PyObject *__pyx_k90p;

static char (__pyx_k90[]) = "Non-placeable geoms do not have a position.";

static PyObject *__pyx_f_3ode_10GeomObject_getPosition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_getPosition[] = "getPosition() -> 3-tuple\n\n        Get the current position of the geom. If the geom is attached to\n        a body the returned value is the body\'s position.\n        ";
static PyObject *__pyx_f_3ode_10GeomObject_getPosition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dReal (*__pyx_v_p);
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  int __pyx_4;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":144 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 144; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 144; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyObject_IsTrue(__pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 144; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = (!__pyx_3);
  if (__pyx_4) {

    /* "/home/zefiris/pyode/src/geomobject.pyx":145 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 145; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k90p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 145; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geomobject.pyx":148 */
  __pyx_v_p = ((dReal (*))dGeomGetPosition(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid));

  /* "/home/zefiris/pyode/src/geomobject.pyx":149 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_5) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
  __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_6, 1, __pyx_1);
  PyTuple_SET_ITEM(__pyx_6, 2, __pyx_5);
  __pyx_2 = 0;
  __pyx_1 = 0;
  __pyx_5 = 0;
  __pyx_r = __pyx_6;
  __pyx_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __Pyx_AddTraceback("ode.GeomObject.getPosition");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_k91p;

static char (__pyx_k91[]) = "Cannot set a rotation on non-placeable geoms.";

static PyObject *__pyx_f_3ode_10GeomObject_setRotation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_setRotation[] = "setRotation(R)\n\n        Set the orientation of the geom. If the geom is attached to a body,\n        the body\'s orientation will also be changed.\n\n        @param R: Rotation matrix\n        @type R: 9-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_10GeomObject_setRotation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_R = 0;
  dMatrix3 __pyx_v_m;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  int __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"R",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_R)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_R);

  /* "/home/zefiris/pyode/src/geomobject.pyx":160 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 160; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 160; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyObject_IsTrue(__pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 160; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = (!__pyx_3);
  if (__pyx_4) {

    /* "/home/zefiris/pyode/src/geomobject.pyx":161 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 161; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k91p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 161; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geomobject.pyx":164 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 164; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_R, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 164; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 164; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_m[0]) = __pyx_5;

  /* "/home/zefiris/pyode/src/geomobject.pyx":165 */
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 165; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_R, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 165; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 165; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_m[1]) = __pyx_5;

  /* "/home/zefiris/pyode/src/geomobject.pyx":166 */
  __pyx_2 = PyInt_FromLong(2); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 166; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_R, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 166; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 166; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_m[2]) = __pyx_5;

  /* "/home/zefiris/pyode/src/geomobject.pyx":167 */
  (__pyx_v_m[3]) = 0;

  /* "/home/zefiris/pyode/src/geomobject.pyx":168 */
  __pyx_2 = PyInt_FromLong(3); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_R, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_m[4]) = __pyx_5;

  /* "/home/zefiris/pyode/src/geomobject.pyx":169 */
  __pyx_2 = PyInt_FromLong(4); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 169; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_R, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 169; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 169; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_m[5]) = __pyx_5;

  /* "/home/zefiris/pyode/src/geomobject.pyx":170 */
  __pyx_2 = PyInt_FromLong(5); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 170; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_R, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 170; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 170; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_m[6]) = __pyx_5;

  /* "/home/zefiris/pyode/src/geomobject.pyx":171 */
  (__pyx_v_m[7]) = 0;

  /* "/home/zefiris/pyode/src/geomobject.pyx":172 */
  __pyx_2 = PyInt_FromLong(6); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_R, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_m[8]) = __pyx_5;

  /* "/home/zefiris/pyode/src/geomobject.pyx":173 */
  __pyx_2 = PyInt_FromLong(7); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_R, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_m[9]) = __pyx_5;

  /* "/home/zefiris/pyode/src/geomobject.pyx":174 */
  __pyx_2 = PyInt_FromLong(8); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 174; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_R, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 174; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 174; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_m[10]) = __pyx_5;

  /* "/home/zefiris/pyode/src/geomobject.pyx":175 */
  (__pyx_v_m[11]) = 0;

  /* "/home/zefiris/pyode/src/geomobject.pyx":176 */
  dGeomSetRotation(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,__pyx_v_m);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.GeomObject.setRotation");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_R);
  return __pyx_r;
}

static PyObject *__pyx_k92p;

static char (__pyx_k92[]) = "Non-placeable geoms do not have a rotation.";

static PyObject *__pyx_f_3ode_10GeomObject_getRotation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_getRotation[] = "getRotation() -> 9-tuple\n\n        Get the current orientation of the geom. If the geom is attached to\n        a body the returned value is the body\'s orientation.\n        ";
static PyObject *__pyx_f_3ode_10GeomObject_getRotation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dReal (*__pyx_v_m);
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  int __pyx_4;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  PyObject *__pyx_8 = 0;
  PyObject *__pyx_9 = 0;
  PyObject *__pyx_10 = 0;
  PyObject *__pyx_11 = 0;
  PyObject *__pyx_12 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":184 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 184; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 184; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyObject_IsTrue(__pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 184; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = (!__pyx_3);
  if (__pyx_4) {

    /* "/home/zefiris/pyode/src/geomobject.pyx":185 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 185; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k92p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 185; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geomobject.pyx":188 */
  __pyx_v_m = ((dReal (*))dGeomGetRotation(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid));

  /* "/home/zefiris/pyode/src/geomobject.pyx":189 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_m[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; goto __pyx_L1;}
  __pyx_1 = PyFloat_FromDouble((__pyx_v_m[1])); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble((__pyx_v_m[2])); if (!__pyx_5) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_m[4])); if (!__pyx_6) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; goto __pyx_L1;}
  __pyx_7 = PyFloat_FromDouble((__pyx_v_m[5])); if (!__pyx_7) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; goto __pyx_L1;}
  __pyx_8 = PyFloat_FromDouble((__pyx_v_m[6])); if (!__pyx_8) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; goto __pyx_L1;}
  __pyx_9 = PyFloat_FromDouble((__pyx_v_m[8])); if (!__pyx_9) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; goto __pyx_L1;}
  __pyx_10 = PyFloat_FromDouble((__pyx_v_m[9])); if (!__pyx_10) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; goto __pyx_L1;}
  __pyx_11 = PyFloat_FromDouble((__pyx_v_m[10])); if (!__pyx_11) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; goto __pyx_L1;}
  __pyx_12 = PyList_New(9); if (!__pyx_12) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; goto __pyx_L1;}
  PyList_SET_ITEM(__pyx_12, 0, __pyx_2);
  PyList_SET_ITEM(__pyx_12, 1, __pyx_1);
  PyList_SET_ITEM(__pyx_12, 2, __pyx_5);
  PyList_SET_ITEM(__pyx_12, 3, __pyx_6);
  PyList_SET_ITEM(__pyx_12, 4, __pyx_7);
  PyList_SET_ITEM(__pyx_12, 5, __pyx_8);
  PyList_SET_ITEM(__pyx_12, 6, __pyx_9);
  PyList_SET_ITEM(__pyx_12, 7, __pyx_10);
  PyList_SET_ITEM(__pyx_12, 8, __pyx_11);
  __pyx_2 = 0;
  __pyx_1 = 0;
  __pyx_5 = 0;
  __pyx_6 = 0;
  __pyx_7 = 0;
  __pyx_8 = 0;
  __pyx_9 = 0;
  __pyx_10 = 0;
  __pyx_11 = 0;
  __pyx_r = __pyx_12;
  __pyx_12 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  Py_XDECREF(__pyx_8);
  Py_XDECREF(__pyx_9);
  Py_XDECREF(__pyx_10);
  Py_XDECREF(__pyx_11);
  Py_XDECREF(__pyx_12);
  __Pyx_AddTraceback("ode.GeomObject.getRotation");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_k93p;

static char (__pyx_k93[]) = "Non-placeable geoms do not have an orientation.";

static PyObject *__pyx_f_3ode_10GeomObject_getQuaternion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_getQuaternion[] = "getQuaternion() -> (w,x,y,z)\n\n        Get the current orientation of the geom. If the geom is attached to\n        a body the returned value is the body\'s orientation.\n        ";
static PyObject *__pyx_f_3ode_10GeomObject_getQuaternion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dQuaternion __pyx_v_q;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  int __pyx_4;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":197 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 197; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 197; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyObject_IsTrue(__pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 197; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = (!__pyx_3);
  if (__pyx_4) {

    /* "/home/zefiris/pyode/src/geomobject.pyx":198 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 198; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k93p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 198; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geomobject.pyx":201 */
  dGeomGetQuaternion(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,__pyx_v_q);

  /* "/home/zefiris/pyode/src/geomobject.pyx":202 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_q[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 202; goto __pyx_L1;}
  __pyx_1 = PyFloat_FromDouble((__pyx_v_q[1])); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 202; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble((__pyx_v_q[2])); if (!__pyx_5) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 202; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_q[3])); if (!__pyx_6) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 202; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(4); if (!__pyx_7) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 202; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_7, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_7, 1, __pyx_1);
  PyTuple_SET_ITEM(__pyx_7, 2, __pyx_5);
  PyTuple_SET_ITEM(__pyx_7, 3, __pyx_6);
  __pyx_2 = 0;
  __pyx_1 = 0;
  __pyx_5 = 0;
  __pyx_6 = 0;
  __pyx_r = __pyx_7;
  __pyx_7 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("ode.GeomObject.getQuaternion");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_k94p;

static char (__pyx_k94[]) = "Cannot set a quaternion on non-placeable geoms.";

static PyObject *__pyx_f_3ode_10GeomObject_setQuaternion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_setQuaternion[] = "setQuaternion(q)\n\n        Set the orientation of the geom. If the geom is attached to a body,\n        the body\'s orientation will also be changed.\n\n        @param q: Quaternion (w,x,y,z)\n        @type q: 4-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_10GeomObject_setQuaternion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_q = 0;
  dQuaternion __pyx_v_cq;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  int __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"q",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_q)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_q);

  /* "/home/zefiris/pyode/src/geomobject.pyx":213 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 213; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 213; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyObject_IsTrue(__pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 213; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = (!__pyx_3);
  if (__pyx_4) {

    /* "/home/zefiris/pyode/src/geomobject.pyx":214 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 214; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k94p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 214; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geomobject.pyx":217 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 217; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_q, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 217; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 217; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_cq[0]) = __pyx_5;

  /* "/home/zefiris/pyode/src/geomobject.pyx":218 */
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 218; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_q, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 218; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 218; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_cq[1]) = __pyx_5;

  /* "/home/zefiris/pyode/src/geomobject.pyx":219 */
  __pyx_2 = PyInt_FromLong(2); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 219; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_q, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 219; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 219; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_cq[2]) = __pyx_5;

  /* "/home/zefiris/pyode/src/geomobject.pyx":220 */
  __pyx_2 = PyInt_FromLong(3); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 220; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_q, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 220; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 220; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_cq[3]) = __pyx_5;

  /* "/home/zefiris/pyode/src/geomobject.pyx":221 */
  dGeomSetQuaternion(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,__pyx_v_cq);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.GeomObject.setQuaternion");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_q);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomObject_getAABB(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_getAABB[] = "getAABB() -> 6-tuple\n\n        Return an axis aligned bounding box that surrounds the geom.\n        The return value is a 6-tuple (minx, maxx, miny, maxy, minz, maxz).\n        ";
static PyObject *__pyx_f_3ode_10GeomObject_getAABB(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dReal (__pyx_v_aabb[6]);
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":231 */
  dGeomGetAABB(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,__pyx_v_aabb);

  /* "/home/zefiris/pyode/src/geomobject.pyx":232 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_aabb[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 232; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_aabb[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 232; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_aabb[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 232; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_aabb[3])); if (!__pyx_4) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 232; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble((__pyx_v_aabb[4])); if (!__pyx_5) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 232; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_aabb[5])); if (!__pyx_6) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 232; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(6); if (!__pyx_7) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 232; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_7, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_7, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_7, 2, __pyx_3);
  PyTuple_SET_ITEM(__pyx_7, 3, __pyx_4);
  PyTuple_SET_ITEM(__pyx_7, 4, __pyx_5);
  PyTuple_SET_ITEM(__pyx_7, 5, __pyx_6);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_4 = 0;
  __pyx_5 = 0;
  __pyx_6 = 0;
  __pyx_r = __pyx_7;
  __pyx_7 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("ode.GeomObject.getAABB");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomObject_isSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_isSpace[] = "isSpace() -> bool\n\n        Return 1 if the given geom is a space, or 0 if not.";
static PyObject *__pyx_f_3ode_10GeomObject_isSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":238 */
  __pyx_1 = PyInt_FromLong(dGeomIsSpace(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 238; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomObject.isSpace");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomObject_getSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_getSpace[] = "getSpace() -> Space\n\n        Return the space that the given geometry is contained in,\n        or return None if it is not contained in any space.";
static PyObject *__pyx_f_3ode_10GeomObject_getSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":245 */
  Py_INCREF(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->space);
  __pyx_r = ((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->space;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_long;

static PyObject *__pyx_f_3ode_10GeomObject_setCollideBits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_setCollideBits[] = "setCollideBits(bits)\n\n        Set the \"collide\" bitfields for this geom.\n\n        @param bits: Collide bit field\n        @type bits: int/long\n        ";
static PyObject *__pyx_f_3ode_10GeomObject_setCollideBits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bits = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  unsigned long __pyx_4;
  static char *__pyx_argnames[] = {"bits",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_bits)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_bits);

  /* "/home/zefiris/pyode/src/geomobject.pyx":255 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_long); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 255; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 255; goto __pyx_L1;}
  Py_INCREF(__pyx_v_bits);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_bits);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 255; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyInt_AsUnsignedLongMask(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 255; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  dGeomSetCollideBits(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,__pyx_4);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.GeomObject.setCollideBits");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_bits);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomObject_setCategoryBits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_setCategoryBits[] = "setCategoryBits(bits)\n\n        Set the \"category\" bitfields for this geom.\n\n        @param bits: Category bit field\n        @type bits: int/long\n        ";
static PyObject *__pyx_f_3ode_10GeomObject_setCategoryBits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bits = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  unsigned long __pyx_4;
  static char *__pyx_argnames[] = {"bits",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_bits)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_bits);

  /* "/home/zefiris/pyode/src/geomobject.pyx":265 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_long); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 265; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 265; goto __pyx_L1;}
  Py_INCREF(__pyx_v_bits);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_bits);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 265; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyInt_AsUnsignedLongMask(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 265; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  dGeomSetCategoryBits(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,__pyx_4);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.GeomObject.setCategoryBits");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_bits);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomObject_getCollideBits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_getCollideBits[] = "getCollideBits() -> long\n\n        Return the \"collide\" bitfields for this geom.\n        ";
static PyObject *__pyx_f_3ode_10GeomObject_getCollideBits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":272 */
  __pyx_1 = PyLong_FromUnsignedLong(dGeomGetCollideBits(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 272; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomObject.getCollideBits");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomObject_getCategoryBits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_getCategoryBits[] = "getCategoryBits() -> long\n\n        Return the \"category\" bitfields for this geom.\n        ";
static PyObject *__pyx_f_3ode_10GeomObject_getCategoryBits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":279 */
  __pyx_1 = PyLong_FromUnsignedLong(dGeomGetCategoryBits(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 279; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomObject.getCategoryBits");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomObject_enable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_enable[] = "enable()\n\n        Enable the geom.";
static PyObject *__pyx_f_3ode_10GeomObject_enable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":285 */
  dGeomEnable(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomObject_disable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_disable[] = "disable()\n\n        Disable the geom.";
static PyObject *__pyx_f_3ode_10GeomObject_disable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":291 */
  dGeomDisable(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomObject_isEnabled(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomObject_isEnabled[] = "isEnabled() -> bool\n\n        Return True if the geom is enabled.";
static PyObject *__pyx_f_3ode_10GeomObject_isEnabled(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/geomobject.pyx":297 */
  __pyx_1 = PyInt_FromLong(dGeomIsEnabled(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomObject.isEnabled");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_space;
static PyObject *__pyx_n_idx;

static PyObject *__pyx_f_3ode_14_SpaceIterator___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ode_14_SpaceIterator___init__ = {"__init__", (PyCFunction)__pyx_f_3ode_14_SpaceIterator___init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_f_3ode_14_SpaceIterator___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {"self","space",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_self, &__pyx_v_space)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_space);

  /* "/home/zefiris/pyode/src/space.pyx":28 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_space, __pyx_v_space) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 28; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/space.pyx":29 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 29; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_idx, __pyx_1) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 29; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode._SpaceIterator.__init__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_14_SpaceIterator___iter__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ode_14_SpaceIterator___iter__ = {"__iter__", (PyCFunction)__pyx_f_3ode_14_SpaceIterator___iter__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_f_3ode_14_SpaceIterator___iter__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {"self",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_self)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/zefiris/pyode/src/space.pyx":32 */
  Py_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_getNumGeoms;
static PyObject *__pyx_n_StopIteration;
static PyObject *__pyx_n_getGeom;

static PyObject *__pyx_f_3ode_14_SpaceIterator_next(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ode_14_SpaceIterator_next = {"next", (PyCFunction)__pyx_f_3ode_14_SpaceIterator_next, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_f_3ode_14_SpaceIterator_next(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_res;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  static char *__pyx_argnames[] = {"self",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_self)) return 0;
  Py_INCREF(__pyx_v_self);
  __pyx_v_res = Py_None; Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/space.pyx":35 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_idx); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 35; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_space); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 35; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_getNumGeoms); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 35; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 35; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 35; goto __pyx_L1;}
  __pyx_4 = __pyx_4 >= 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_4) {

    /* "/home/zefiris/pyode/src/space.pyx":36 */
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_StopIteration); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 36; goto __pyx_L1;}
    __Pyx_Raise(__pyx_3, 0, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[6]; __pyx_lineno = 36; goto __pyx_L1;}
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/zefiris/pyode/src/space.pyx":38 */
    __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_space); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; goto __pyx_L1;}
    __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_getGeom); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_idx); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; goto __pyx_L1;}
    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
    __pyx_3 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_v_res);
    __pyx_v_res = __pyx_3;
    __pyx_3 = 0;

    /* "/home/zefiris/pyode/src/space.pyx":39 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_idx); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 39; goto __pyx_L1;}
    __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 39; goto __pyx_L1;}
    __pyx_3 = PyNumber_Add(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 39; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_idx, __pyx_3) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 39; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/home/zefiris/pyode/src/space.pyx":40 */
    Py_INCREF(__pyx_v_res);
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode._SpaceIterator.next");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_res);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_3ode_9SpaceBase___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_9SpaceBase___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_r;
  static char *__pyx_argnames[] = {0};
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_a, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_a);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/space.pyx":70 */

  __pyx_r = 0;
  Py_XDECREF(__pyx_v_a);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static PyObject *__pyx_k95p;

static char (__pyx_k95[]) = "The SpaceBase class can't be used directly.";

static int __pyx_f_3ode_9SpaceBase___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_9SpaceBase___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_a, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_a);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/space.pyx":73 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 73; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k95p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[6]; __pyx_lineno = 73; goto __pyx_L1;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.SpaceBase.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_a);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static void __pyx_f_3ode_9SpaceBase___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_f_3ode_9SpaceBase___dealloc__(PyObject *__pyx_v_self) {
  int __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/space.pyx":76 */
  __pyx_1 = (((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->__pyx_base.gid != NULL);
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/space.pyx":77 */
    dSpaceDestroy(((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid);

    /* "/home/zefiris/pyode/src/space.pyx":78 */
    ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid = NULL;

    /* "/home/zefiris/pyode/src/space.pyx":79 */
    ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->__pyx_base.gid = NULL;
    goto __pyx_L2;
  }
  __pyx_L2:;

  Py_DECREF((PyObject *)__pyx_v_self);
}

static PyObject *__pyx_f_3ode_9SpaceBase__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_9SpaceBase__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_id;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/space.pyx":102 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid);

  /* "/home/zefiris/pyode/src/space.pyx":103 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 103; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.SpaceBase._id");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_3ode_9SpaceBase___len__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_f_3ode_9SpaceBase___len__(PyObject *__pyx_v_self) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/space.pyx":106 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_getNumGeoms); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 106; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 106; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 106; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_r = __pyx_3;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.SpaceBase.__len__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9SpaceBase___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_3ode_9SpaceBase___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/space.pyx":109 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__SpaceIterator); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 109; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 109; goto __pyx_L1;}
  Py_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 109; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.SpaceBase.__iter__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9SpaceBase_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_9SpaceBase_add[] = "add(geom)\n\n        Add a geom to a space. This does nothing if the geom is\n        already in the space.\n\n        @param geom: Geom object to add\n        @type geom: GeomObject\n        ";
static PyObject *__pyx_f_3ode_9SpaceBase_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_GeomObject *__pyx_v_geom = 0;
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {"geom",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_geom)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_geom);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_3ode_GeomObject, 1, "geom")) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 111; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/space.pyx":121 */
  dSpaceAdd(((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid,__pyx_v_geom->gid);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.SpaceBase.add");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_geom);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9SpaceBase_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_9SpaceBase_remove[] = "remove(geom)\n\n        Remove a geom from a space.\n\n        @param geom: Geom object to remove\n        @type geom: GeomObject\n        ";
static PyObject *__pyx_f_3ode_9SpaceBase_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_GeomObject *__pyx_v_geom = 0;
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {"geom",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_geom)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_geom);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_3ode_GeomObject, 1, "geom")) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 123; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/space.pyx":131 */
  dSpaceRemove(((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid,__pyx_v_geom->gid);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.SpaceBase.remove");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_geom);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9SpaceBase_query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_9SpaceBase_query[] = "query(geom) -> bool\n\n        Return True if the given geom is in the space.\n\n        @param geom: Geom object to check\n        @type geom: GeomObject\n        ";
static PyObject *__pyx_f_3ode_9SpaceBase_query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_GeomObject *__pyx_v_geom = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {"geom",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_geom)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_geom);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_3ode_GeomObject, 1, "geom")) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 133; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/space.pyx":141 */
  __pyx_1 = PyInt_FromLong(dSpaceQuery(((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid,__pyx_v_geom->gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 141; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.SpaceBase.query");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_geom);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9SpaceBase_getNumGeoms(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_9SpaceBase_getNumGeoms[] = "getNumGeoms() -> int\n\n        Return the number of geoms contained within the space.\n        ";
static PyObject *__pyx_f_3ode_9SpaceBase_getNumGeoms(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/space.pyx":148 */
  __pyx_1 = PyInt_FromLong(dSpaceGetNumGeoms(((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid)); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 148; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.SpaceBase.getNumGeoms");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_RuntimeError;

static PyObject *__pyx_k96p;
static PyObject *__pyx_k97p;

static char (__pyx_k96[]) = "geom index out of range";
static char (__pyx_k97[]) = "geom id cannot be translated to a Python object";

static PyObject *__pyx_f_3ode_9SpaceBase_getGeom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_9SpaceBase_getGeom[] = "getGeom(idx) -> GeomObject\n\n        Return the geom with the given index contained within the space.\n\n        @param idx: Geom index (0,1,...,getNumGeoms()-1)\n        @type idx: int\n        ";
static PyObject *__pyx_f_3ode_9SpaceBase_getGeom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_idx;
  dGeomID __pyx_v_gid;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"idx",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_idx)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/space.pyx":161 */
  __pyx_1 = (__pyx_v_idx < 0);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_idx >= dSpaceGetNumGeoms(((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid));
  }
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/space.pyx":162 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_IndexError); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 162; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k96p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[6]; __pyx_lineno = 162; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/space.pyx":164 */
  __pyx_v_gid = dSpaceGetGeom(((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid,__pyx_v_idx);

  /* "/home/zefiris/pyode/src/space.pyx":165 */
  __pyx_2 = PyInt_FromLong(((long )__pyx_v_gid)); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 165; goto __pyx_L1;}
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 165; goto __pyx_L1;}
  __pyx_1 = PySequence_Contains(__pyx_3, __pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 165; goto __pyx_L1;}
  __pyx_1 = !__pyx_1;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/space.pyx":166 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 166; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k97p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[6]; __pyx_lineno = 166; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/zefiris/pyode/src/space.pyx":168 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 168; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(((long )__pyx_v_gid)); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 168; goto __pyx_L1;}
  __pyx_4 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 168; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.SpaceBase.getGeom");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9SpaceBase_collide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_9SpaceBase_collide[] = "collide(arg, callback)\n\n        Call a callback function one or more times, for all\n        potentially intersecting objects in the space. The callback\n        function takes 3 arguments:\n\n        def NearCallback(arg, geom1, geom2):\n\n        The arg parameter is just passed on to the callback function.\n        Its meaning is user defined. The geom1 and geom2 arguments are\n        the geometry objects that may be near each other. The callback\n        function can call the function collide() (not the Space\n        method) on geom1 and geom2, perhaps first determining\n        whether to collide them at all based on other information.\n\n        @param arg: A user argument that is passed to the callback function\n        @param callback: Callback function\n        @type callback: callable\n        ";
static PyObject *__pyx_f_3ode_9SpaceBase_collide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arg = 0;
  PyObject *__pyx_v_callback = 0;
  void (*__pyx_v_data);
  PyObject *__pyx_v_tup;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {"arg","callback",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_arg, &__pyx_v_callback)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_arg);
  Py_INCREF(__pyx_v_callback);
  __pyx_v_tup = Py_None; Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/space.pyx":193 */
  __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 193; goto __pyx_L1;}
  Py_INCREF(__pyx_v_callback);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_callback);
  Py_INCREF(__pyx_v_arg);
  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_arg);
  Py_DECREF(__pyx_v_tup);
  __pyx_v_tup = __pyx_1;
  __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/space.pyx":194 */
  __pyx_v_data = ((void (*))__pyx_v_tup);

  /* "/home/zefiris/pyode/src/space.pyx":195 */
  dSpaceCollide(((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid,__pyx_v_data,__pyx_f_3ode_collide_callback);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.SpaceBase.collide");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_tup);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_arg);
  Py_DECREF(__pyx_v_callback);
  return __pyx_r;
}

static void __pyx_f_3ode_collide_callback(void (*__pyx_v_data),dGeomID __pyx_v_o1,dGeomID __pyx_v_o2) {
  PyObject *__pyx_v_tup;
  long __pyx_v_id1;
  long __pyx_v_id2;
  PyObject *__pyx_v_callback;
  PyObject *__pyx_v_arg;
  PyObject *__pyx_v_g1;
  PyObject *__pyx_v_g2;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  __pyx_v_tup = Py_None; Py_INCREF(Py_None);
  __pyx_v_callback = Py_None; Py_INCREF(Py_None);
  __pyx_v_arg = Py_None; Py_INCREF(Py_None);
  __pyx_v_g1 = Py_None; Py_INCREF(Py_None);
  __pyx_v_g2 = Py_None; Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/space.pyx":211 */
  __pyx_1 = (PyObject *)__pyx_v_data;
  Py_INCREF(__pyx_1);
  Py_DECREF(__pyx_v_tup);
  __pyx_v_tup = __pyx_1;
  __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/space.pyx":212 */
  __pyx_1 = PyObject_GetIter(__pyx_v_tup); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 212; goto __pyx_L1;}
  __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 212; goto __pyx_L1;}
  Py_DECREF(__pyx_v_callback);
  __pyx_v_callback = __pyx_2;
  __pyx_2 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 212; goto __pyx_L1;}
  Py_DECREF(__pyx_v_arg);
  __pyx_v_arg = __pyx_2;
  __pyx_2 = 0;
  if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 212; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/space.pyx":213 */
  __pyx_v_id1 = ((long )__pyx_v_o1);

  /* "/home/zefiris/pyode/src/space.pyx":214 */
  __pyx_v_id2 = ((long )__pyx_v_o2);

  /* "/home/zefiris/pyode/src/space.pyx":215 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 215; goto __pyx_L1;}
  __pyx_1 = PyInt_FromLong(__pyx_v_id1); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 215; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 215; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_g1);
  __pyx_v_g1 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/zefiris/pyode/src/space.pyx":216 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 216; goto __pyx_L1;}
  __pyx_1 = PyInt_FromLong(__pyx_v_id2); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 216; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 216; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_g2);
  __pyx_v_g2 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/zefiris/pyode/src/space.pyx":217 */
  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 217; goto __pyx_L1;}
  Py_INCREF(__pyx_v_arg);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_arg);
  Py_INCREF(__pyx_v_g1);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_g1);
  Py_INCREF(__pyx_v_g2);
  PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_g2);
  __pyx_1 = PyObject_CallObject(__pyx_v_callback, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 217; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_WriteUnraisable("ode.collide_callback");
  __pyx_L0:;
  Py_DECREF(__pyx_v_tup);
  Py_DECREF(__pyx_v_callback);
  Py_DECREF(__pyx_v_arg);
  Py_DECREF(__pyx_v_g1);
  Py_DECREF(__pyx_v_g2);
}

static int __pyx_f_3ode_11SimpleSpace___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_11SimpleSpace___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  struct __pyx_obj_3ode_SpaceBase *__pyx_v_sp;
  dSpaceID __pyx_v_parentid;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"space",0};
  __pyx_v_space = __pyx_k25;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)Py_None); Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/space.pyx":237 */
  __pyx_v_parentid = NULL;

  /* "/home/zefiris/pyode/src/space.pyx":238 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 238; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/space.pyx":239 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 239; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF(((PyObject *)__pyx_v_sp));
    __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_space);

    /* "/home/zefiris/pyode/src/space.pyx":240 */
    __pyx_v_parentid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/space.pyx":242 */
  ((struct __pyx_obj_3ode_SimpleSpace *)__pyx_v_self)->__pyx_base.sid = dSimpleSpaceCreate(__pyx_v_parentid);

  /* "/home/zefiris/pyode/src/space.pyx":245 */
  ((struct __pyx_obj_3ode_SimpleSpace *)__pyx_v_self)->__pyx_base.__pyx_base.gid = ((struct dxGeom (*))((struct __pyx_obj_3ode_SimpleSpace *)__pyx_v_self)->__pyx_base.sid);

  /* "/home/zefiris/pyode/src/space.pyx":247 */
  dSpaceSetCleanup(((struct __pyx_obj_3ode_SimpleSpace *)__pyx_v_self)->__pyx_base.sid,0);

  /* "/home/zefiris/pyode/src/space.pyx":248 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 248; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(((long )((struct __pyx_obj_3ode_SimpleSpace *)__pyx_v_self)->__pyx_base.sid)); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 248; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_2, __pyx_3, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 248; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.SimpleSpace.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_sp);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  return __pyx_r;
}

static int __pyx_f_3ode_11SimpleSpace___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_11SimpleSpace___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  int __pyx_r;
  static char *__pyx_argnames[] = {"space",0};
  __pyx_v_space = __pyx_k26;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);

  /* "/home/zefiris/pyode/src/space.pyx":251 */

  __pyx_r = 0;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  return __pyx_r;
}

static int __pyx_f_3ode_9HashSpace___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_9HashSpace___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  struct __pyx_obj_3ode_SpaceBase *__pyx_v_sp;
  dSpaceID __pyx_v_parentid;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"space",0};
  __pyx_v_space = __pyx_k27;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)Py_None); Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/space.pyx":270 */
  __pyx_v_parentid = NULL;

  /* "/home/zefiris/pyode/src/space.pyx":271 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 271; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/space.pyx":272 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 272; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF(((PyObject *)__pyx_v_sp));
    __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_space);

    /* "/home/zefiris/pyode/src/space.pyx":273 */
    __pyx_v_parentid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/space.pyx":275 */
  ((struct __pyx_obj_3ode_HashSpace *)__pyx_v_self)->__pyx_base.sid = dHashSpaceCreate(__pyx_v_parentid);

  /* "/home/zefiris/pyode/src/space.pyx":278 */
  ((struct __pyx_obj_3ode_HashSpace *)__pyx_v_self)->__pyx_base.__pyx_base.gid = ((struct dxGeom (*))((struct __pyx_obj_3ode_HashSpace *)__pyx_v_self)->__pyx_base.sid);

  /* "/home/zefiris/pyode/src/space.pyx":280 */
  dSpaceSetCleanup(((struct __pyx_obj_3ode_HashSpace *)__pyx_v_self)->__pyx_base.sid,0);

  /* "/home/zefiris/pyode/src/space.pyx":281 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 281; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(((long )((struct __pyx_obj_3ode_HashSpace *)__pyx_v_self)->__pyx_base.sid)); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 281; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_2, __pyx_3, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 281; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.HashSpace.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_sp);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  return __pyx_r;
}

static int __pyx_f_3ode_9HashSpace___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_9HashSpace___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  int __pyx_r;
  static char *__pyx_argnames[] = {"space",0};
  __pyx_v_space = __pyx_k28;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);

  /* "/home/zefiris/pyode/src/space.pyx":284 */

  __pyx_r = 0;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  return __pyx_r;
}

static PyObject *__pyx_k98p;

static char (__pyx_k98[]) = "minlevel (%d) must be less than or equal to maxlevel (%d)";

static PyObject *__pyx_f_3ode_9HashSpace_setLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_9HashSpace_setLevels[] = "setLevels(minlevel, maxlevel)\n\n        Sets the size of the smallest and largest cell used in the\n        hash table. The actual size will be 2^minlevel and 2^maxlevel\n        respectively.\n        ";
static PyObject *__pyx_f_3ode_9HashSpace_setLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_minlevel;
  int __pyx_v_maxlevel;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"minlevel","maxlevel",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "ii", __pyx_argnames, &__pyx_v_minlevel, &__pyx_v_maxlevel)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/space.pyx":294 */
  __pyx_1 = (__pyx_v_minlevel > __pyx_v_maxlevel);
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/space.pyx":295 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 295; goto __pyx_L1;}
    __pyx_3 = PyInt_FromLong(__pyx_v_minlevel); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 295; goto __pyx_L1;}
    __pyx_4 = PyInt_FromLong(__pyx_v_maxlevel); if (!__pyx_4) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 295; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 295; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_3);
    PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
    __pyx_3 = 0;
    __pyx_4 = 0;
    __pyx_3 = PyNumber_Remainder(__pyx_k98p, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 295; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[6]; __pyx_lineno = 295; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/space.pyx":297 */
  dHashSpaceSetLevels(((struct __pyx_obj_3ode_HashSpace *)__pyx_v_self)->__pyx_base.sid,__pyx_v_minlevel,__pyx_v_maxlevel);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("ode.HashSpace.setLevels");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9HashSpace_getLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_9HashSpace_getLevels[] = "getLevels() -> (minlevel, maxlevel)\n\n        Gets the size of the smallest and largest cell used in the\n        hash table. The actual size is 2^minlevel and 2^maxlevel\n        respectively.\n        ";
static PyObject *__pyx_f_3ode_9HashSpace_getLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_minlevel;
  int __pyx_v_maxlevel;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/space.pyx":309 */
  dHashSpaceGetLevels(((struct __pyx_obj_3ode_HashSpace *)__pyx_v_self)->__pyx_base.sid,(&__pyx_v_minlevel),(&__pyx_v_maxlevel));

  /* "/home/zefiris/pyode/src/space.pyx":310 */
  __pyx_1 = PyInt_FromLong(__pyx_v_minlevel); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 310; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(__pyx_v_maxlevel); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 310; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 310; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.HashSpace.getLevels");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_3ode_13QuadTreeSpace___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_13QuadTreeSpace___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_center = 0;
  PyObject *__pyx_v_extents = 0;
  PyObject *__pyx_v_depth = 0;
  PyObject *__pyx_v_space = 0;
  struct __pyx_obj_3ode_SpaceBase *__pyx_v_sp;
  dSpaceID __pyx_v_parentid;
  dVector3 __pyx_v_c;
  dVector3 __pyx_v_e;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  dReal __pyx_4;
  static char *__pyx_argnames[] = {"center","extents","depth","space",0};
  __pyx_v_space = __pyx_k29;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|O", __pyx_argnames, &__pyx_v_center, &__pyx_v_extents, &__pyx_v_depth, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_center);
  Py_INCREF(__pyx_v_extents);
  Py_INCREF(__pyx_v_depth);
  Py_INCREF(__pyx_v_space);
  __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)Py_None); Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/space.pyx":331 */
  __pyx_v_parentid = NULL;

  /* "/home/zefiris/pyode/src/space.pyx":332 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 332; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/space.pyx":333 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 333; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF(((PyObject *)__pyx_v_sp));
    __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_space);

    /* "/home/zefiris/pyode/src/space.pyx":334 */
    __pyx_v_parentid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/space.pyx":336 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 336; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_center, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 336; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 336; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_c[0]) = __pyx_4;

  /* "/home/zefiris/pyode/src/space.pyx":337 */
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 337; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_center, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 337; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 337; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_c[1]) = __pyx_4;

  /* "/home/zefiris/pyode/src/space.pyx":338 */
  __pyx_2 = PyInt_FromLong(2); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 338; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_center, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 338; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 338; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_c[2]) = __pyx_4;

  /* "/home/zefiris/pyode/src/space.pyx":339 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 339; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_extents, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 339; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 339; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_e[0]) = __pyx_4;

  /* "/home/zefiris/pyode/src/space.pyx":340 */
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 340; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_extents, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 340; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 340; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_e[1]) = __pyx_4;

  /* "/home/zefiris/pyode/src/space.pyx":341 */
  __pyx_2 = PyInt_FromLong(2); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 341; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_extents, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_e[2]) = __pyx_4;

  /* "/home/zefiris/pyode/src/space.pyx":342 */
  __pyx_1 = PyInt_AsLong(__pyx_v_depth); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 342; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_QuadTreeSpace *)__pyx_v_self)->__pyx_base.sid = dQuadTreeSpaceCreate(__pyx_v_parentid,__pyx_v_c,__pyx_v_e,__pyx_1);

  /* "/home/zefiris/pyode/src/space.pyx":345 */
  ((struct __pyx_obj_3ode_QuadTreeSpace *)__pyx_v_self)->__pyx_base.__pyx_base.gid = ((struct dxGeom (*))((struct __pyx_obj_3ode_QuadTreeSpace *)__pyx_v_self)->__pyx_base.sid);

  /* "/home/zefiris/pyode/src/space.pyx":347 */
  dSpaceSetCleanup(((struct __pyx_obj_3ode_QuadTreeSpace *)__pyx_v_self)->__pyx_base.sid,0);

  /* "/home/zefiris/pyode/src/space.pyx":348 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 348; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(((long )((struct __pyx_obj_3ode_QuadTreeSpace *)__pyx_v_self)->__pyx_base.sid)); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 348; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_2, __pyx_3, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 348; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.QuadTreeSpace.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_sp);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_center);
  Py_DECREF(__pyx_v_extents);
  Py_DECREF(__pyx_v_depth);
  Py_DECREF(__pyx_v_space);
  return __pyx_r;
}

static int __pyx_f_3ode_13QuadTreeSpace___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_13QuadTreeSpace___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_center = 0;
  PyObject *__pyx_v_extents = 0;
  PyObject *__pyx_v_depth = 0;
  PyObject *__pyx_v_space = 0;
  int __pyx_r;
  static char *__pyx_argnames[] = {"center","extents","depth","space",0};
  __pyx_v_space = __pyx_k30;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|O", __pyx_argnames, &__pyx_v_center, &__pyx_v_extents, &__pyx_v_depth, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_center);
  Py_INCREF(__pyx_v_extents);
  Py_INCREF(__pyx_v_depth);
  Py_INCREF(__pyx_v_space);

  /* "/home/zefiris/pyode/src/space.pyx":351 */

  __pyx_r = 0;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_center);
  Py_DECREF(__pyx_v_extents);
  Py_DECREF(__pyx_v_depth);
  Py_DECREF(__pyx_v_space);
  return __pyx_r;
}

static PyObject *__pyx_k99p;

static char (__pyx_k99[]) = "Unknown space type (%d)";

static PyObject *__pyx_f_3ode_Space(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_Space[] = "Space factory function.\n\n    Depending on the type argument this function either returns a\n    SimpleSpace (type=0) or a HashSpace (type=1).\n\n    This function is provided to remain compatible with previous\n    versions of PyODE where there was only one Space class.\n    \n     >>> space = Space(type=0)   # Create a SimpleSpace\n     >>> space = Space(type=1)   # Create a HashSpace\n    ";
static PyObject *__pyx_f_3ode_Space(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"type",0};
  __pyx_v_type = __pyx_k31;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_type)) return 0;
  Py_INCREF(__pyx_v_type);

  /* "/home/zefiris/pyode/src/space.pyx":366 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 366; goto __pyx_L1;}
  if (PyObject_Cmp(__pyx_v_type, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 366; goto __pyx_L1;}
  __pyx_2 = __pyx_2 == 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/zefiris/pyode/src/space.pyx":367 */
    __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_3ode_SimpleSpace), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 367; goto __pyx_L1;}
    __pyx_r = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 368; goto __pyx_L1;}
  if (PyObject_Cmp(__pyx_v_type, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 368; goto __pyx_L1;}
  __pyx_2 = __pyx_2 == 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/zefiris/pyode/src/space.pyx":369 */
    __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_3ode_HashSpace), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 369; goto __pyx_L1;}
    __pyx_r = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/zefiris/pyode/src/space.pyx":371 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 371; goto __pyx_L1;}
    __pyx_3 = PyNumber_Remainder(__pyx_k99p, __pyx_v_type); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 371; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_3, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[6]; __pyx_lineno = 371; goto __pyx_L1;}
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.Space");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_type);
  return __pyx_r;
}

static int __pyx_f_3ode_10GeomSphere___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_10GeomSphere___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_radius = 0;
  struct __pyx_obj_3ode_SpaceBase *__pyx_v_sp;
  dSpaceID __pyx_v_sid;
  int __pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"space","radius",0};
  __pyx_v_space = __pyx_k32;
  __pyx_v_radius = __pyx_k33;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_space, &__pyx_v_radius)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  Py_INCREF(__pyx_v_radius);
  __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)Py_None); Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/geoms.pyx":37 */
  __pyx_v_sid = NULL;

  /* "/home/zefiris/pyode/src/geoms.pyx":38 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 38; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/geoms.pyx":39 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 39; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF(((PyObject *)__pyx_v_sp));
    __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_space);

    /* "/home/zefiris/pyode/src/geoms.pyx":40 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geoms.pyx":41 */
  __pyx_2 = PyFloat_AsDouble(__pyx_v_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 41; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_GeomSphere *)__pyx_v_self)->__pyx_base.gid = dCreateSphere(__pyx_v_sid,__pyx_2);

  /* "/home/zefiris/pyode/src/geoms.pyx":45 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 45; goto __pyx_L1;}
  __pyx_4 = PyInt_FromLong(((long )((struct __pyx_obj_3ode_GeomSphere *)__pyx_v_self)->__pyx_base.gid)); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 45; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_3, __pyx_4, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 45; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.GeomSphere.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_sp);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  Py_DECREF(__pyx_v_radius);
  return __pyx_r;
}

static int __pyx_f_3ode_10GeomSphere___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_10GeomSphere___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_radius = 0;
  int __pyx_r;
  static char *__pyx_argnames[] = {"space","radius",0};
  __pyx_v_space = __pyx_k34;
  __pyx_v_radius = __pyx_k35;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_space, &__pyx_v_radius)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  Py_INCREF(__pyx_v_radius);

  /* "/home/zefiris/pyode/src/geoms.pyx":49 */
  Py_INCREF(__pyx_v_space);
  Py_DECREF(((struct __pyx_obj_3ode_GeomSphere *)__pyx_v_self)->__pyx_base.space);
  ((struct __pyx_obj_3ode_GeomSphere *)__pyx_v_self)->__pyx_base.space = __pyx_v_space;

  /* "/home/zefiris/pyode/src/geoms.pyx":50 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_3ode_GeomSphere *)__pyx_v_self)->__pyx_base.body);
  ((struct __pyx_obj_3ode_GeomSphere *)__pyx_v_self)->__pyx_base.body = Py_None;

  __pyx_r = 0;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  Py_DECREF(__pyx_v_radius);
  return __pyx_r;
}

static PyObject *__pyx_n_True;

static PyObject *__pyx_f_3ode_10GeomSphere_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_10GeomSphere_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":53 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 53; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomSphere.placeable");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomSphere__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_10GeomSphere__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_id;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":57 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomSphere *)__pyx_v_self)->__pyx_base.gid);

  /* "/home/zefiris/pyode/src/geoms.pyx":58 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 58; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomSphere._id");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomSphere_setRadius(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomSphere_setRadius[] = "setRadius(radius)\n\n        Set the radius of the sphere.\n\n        @param radius: New radius\n        @type radius: float\n        ";
static PyObject *__pyx_f_3ode_10GeomSphere_setRadius(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_radius = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"radius",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_radius)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_radius);

  /* "/home/zefiris/pyode/src/geoms.pyx":68 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 68; goto __pyx_L1;}
  dGeomSphereSetRadius(((struct __pyx_obj_3ode_GeomSphere *)__pyx_v_self)->__pyx_base.gid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomSphere.setRadius");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_radius);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomSphere_getRadius(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomSphere_getRadius[] = "getRadius() -> float\n\n        Return the radius of the sphere.\n        ";
static PyObject *__pyx_f_3ode_10GeomSphere_getRadius(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":75 */
  __pyx_1 = PyFloat_FromDouble(dGeomSphereGetRadius(((struct __pyx_obj_3ode_GeomSphere *)__pyx_v_self)->__pyx_base.gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomSphere.getRadius");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_10GeomSphere_pointDepth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_10GeomSphere_pointDepth[] = "pointDepth(p) -> float\n\n        Return the depth of the point p in the sphere. Points inside\n        the geom will have positive depth, points outside it will have\n        negative depth, and points on the surface will have zero\n        depth.\n\n        @param p: Point\n        @type p: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_10GeomSphere_pointDepth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"p",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_p)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_p);

  /* "/home/zefiris/pyode/src/geoms.pyx":88 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyFloat_FromDouble(dGeomSpherePointDepth(((struct __pyx_obj_3ode_GeomSphere *)__pyx_v_self)->__pyx_base.gid,__pyx_3,__pyx_4,__pyx_5)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.GeomSphere.pointDepth");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static int __pyx_f_3ode_7GeomBox___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_7GeomBox___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_lengths = 0;
  struct __pyx_obj_3ode_SpaceBase *__pyx_v_sp;
  dSpaceID __pyx_v_sid;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  dReal __pyx_4;
  dReal __pyx_5;
  dReal __pyx_6;
  static char *__pyx_argnames[] = {"space","lengths",0};
  __pyx_v_space = __pyx_k36;
  __pyx_v_lengths = __pyx_k37;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_space, &__pyx_v_lengths)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  Py_INCREF(__pyx_v_lengths);
  __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)Py_None); Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/geoms.pyx":106 */
  __pyx_v_sid = NULL;

  /* "/home/zefiris/pyode/src/geoms.pyx":107 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 107; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/geoms.pyx":108 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 108; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF(((PyObject *)__pyx_v_sp));
    __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_space);

    /* "/home/zefiris/pyode/src/geoms.pyx":109 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geoms.pyx":110 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_lengths, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_lengths, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyInt_FromLong(2); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_lengths, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  ((struct __pyx_obj_3ode_GeomBox *)__pyx_v_self)->__pyx_base.gid = dCreateBox(__pyx_v_sid,__pyx_4,__pyx_5,__pyx_6);

  /* "/home/zefiris/pyode/src/geoms.pyx":114 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 114; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(((long )((struct __pyx_obj_3ode_GeomBox *)__pyx_v_self)->__pyx_base.gid)); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 114; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_2, __pyx_3, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 114; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.GeomBox.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_sp);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  Py_DECREF(__pyx_v_lengths);
  return __pyx_r;
}

static int __pyx_f_3ode_7GeomBox___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_7GeomBox___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_lengths = 0;
  int __pyx_r;
  static char *__pyx_argnames[] = {"space","lengths",0};
  __pyx_v_space = __pyx_k38;
  __pyx_v_lengths = __pyx_k39;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_space, &__pyx_v_lengths)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  Py_INCREF(__pyx_v_lengths);

  /* "/home/zefiris/pyode/src/geoms.pyx":117 */
  Py_INCREF(__pyx_v_space);
  Py_DECREF(((struct __pyx_obj_3ode_GeomBox *)__pyx_v_self)->__pyx_base.space);
  ((struct __pyx_obj_3ode_GeomBox *)__pyx_v_self)->__pyx_base.space = __pyx_v_space;

  /* "/home/zefiris/pyode/src/geoms.pyx":118 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_3ode_GeomBox *)__pyx_v_self)->__pyx_base.body);
  ((struct __pyx_obj_3ode_GeomBox *)__pyx_v_self)->__pyx_base.body = Py_None;

  __pyx_r = 0;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  Py_DECREF(__pyx_v_lengths);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7GeomBox_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_7GeomBox_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":121 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 121; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomBox.placeable");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7GeomBox__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_7GeomBox__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_id;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":125 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomBox *)__pyx_v_self)->__pyx_base.gid);

  /* "/home/zefiris/pyode/src/geoms.pyx":126 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 126; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomBox._id");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7GeomBox_setLengths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_7GeomBox_setLengths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_lengths = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"lengths",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_lengths)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_lengths);

  /* "/home/zefiris/pyode/src/geoms.pyx":129 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 129; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_lengths, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 129; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 129; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 129; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_lengths, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 129; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 129; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 129; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_lengths, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 129; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 129; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dGeomBoxSetLengths(((struct __pyx_obj_3ode_GeomBox *)__pyx_v_self)->__pyx_base.gid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.GeomBox.setLengths");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_lengths);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7GeomBox_getLengths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_7GeomBox_getLengths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_res;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":133 */
  dGeomBoxGetLengths(((struct __pyx_obj_3ode_GeomBox *)__pyx_v_self)->__pyx_base.gid,__pyx_v_res);

  /* "/home/zefiris/pyode/src/geoms.pyx":134 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 134; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 134; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 134; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 134; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.GeomBox.getLengths");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7GeomBox_pointDepth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7GeomBox_pointDepth[] = "pointDepth(p) -> float\n\n        Return the depth of the point p in the box. Points inside the\n        geom will have positive depth, points outside it will have\n        negative depth, and points on the surface will have zero\n        depth.\n\n        @param p: Point\n        @type p: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_7GeomBox_pointDepth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"p",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_p)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_p);

  /* "/home/zefiris/pyode/src/geoms.pyx":147 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyFloat_FromDouble(dGeomBoxPointDepth(((struct __pyx_obj_3ode_GeomBox *)__pyx_v_self)->__pyx_base.gid,__pyx_3,__pyx_4,__pyx_5)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.GeomBox.pointDepth");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static int __pyx_f_3ode_9GeomPlane___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_9GeomPlane___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_normal = 0;
  PyObject *__pyx_v_dist = 0;
  struct __pyx_obj_3ode_SpaceBase *__pyx_v_sp;
  dSpaceID __pyx_v_sid;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  dReal __pyx_4;
  dReal __pyx_5;
  dReal __pyx_6;
  dReal __pyx_7;
  static char *__pyx_argnames[] = {"space","normal","dist",0};
  __pyx_v_space = __pyx_k40;
  __pyx_v_normal = __pyx_k41;
  __pyx_v_dist = __pyx_k42;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_space, &__pyx_v_normal, &__pyx_v_dist)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  Py_INCREF(__pyx_v_normal);
  Py_INCREF(__pyx_v_dist);
  __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)Py_None); Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/geoms.pyx":170 */
  __pyx_v_sid = NULL;

  /* "/home/zefiris/pyode/src/geoms.pyx":171 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 171; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/geoms.pyx":172 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF(((PyObject *)__pyx_v_sp));
    __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_space);

    /* "/home/zefiris/pyode/src/geoms.pyx":173 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geoms.pyx":174 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_normal, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_normal, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyInt_FromLong(2); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_normal, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_7 = PyFloat_AsDouble(__pyx_v_dist); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_GeomPlane *)__pyx_v_self)->__pyx_base.gid = dCreatePlane(__pyx_v_sid,__pyx_4,__pyx_5,__pyx_6,__pyx_7);

  /* "/home/zefiris/pyode/src/geoms.pyx":178 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 178; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(((long )((struct __pyx_obj_3ode_GeomPlane *)__pyx_v_self)->__pyx_base.gid)); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 178; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_2, __pyx_3, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 178; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.GeomPlane.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_sp);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  Py_DECREF(__pyx_v_normal);
  Py_DECREF(__pyx_v_dist);
  return __pyx_r;
}

static int __pyx_f_3ode_9GeomPlane___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_9GeomPlane___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_normal = 0;
  PyObject *__pyx_v_dist = 0;
  int __pyx_r;
  static char *__pyx_argnames[] = {"space","normal","dist",0};
  __pyx_v_space = __pyx_k43;
  __pyx_v_normal = __pyx_k44;
  __pyx_v_dist = __pyx_k45;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_space, &__pyx_v_normal, &__pyx_v_dist)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  Py_INCREF(__pyx_v_normal);
  Py_INCREF(__pyx_v_dist);

  /* "/home/zefiris/pyode/src/geoms.pyx":182 */
  Py_INCREF(__pyx_v_space);
  Py_DECREF(((struct __pyx_obj_3ode_GeomPlane *)__pyx_v_self)->__pyx_base.space);
  ((struct __pyx_obj_3ode_GeomPlane *)__pyx_v_self)->__pyx_base.space = __pyx_v_space;

  __pyx_r = 0;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  Py_DECREF(__pyx_v_normal);
  Py_DECREF(__pyx_v_dist);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9GeomPlane__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_9GeomPlane__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_id;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":187 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomPlane *)__pyx_v_self)->__pyx_base.gid);

  /* "/home/zefiris/pyode/src/geoms.pyx":188 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 188; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomPlane._id");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9GeomPlane_setParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_9GeomPlane_setParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_normal = 0;
  PyObject *__pyx_v_dist = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  dReal __pyx_6;
  static char *__pyx_argnames[] = {"normal","dist",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_normal, &__pyx_v_dist)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_normal);
  Py_INCREF(__pyx_v_dist);

  /* "/home/zefiris/pyode/src/geoms.pyx":191 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_v_dist); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; goto __pyx_L1;}
  dGeomPlaneSetParams(((struct __pyx_obj_3ode_GeomPlane *)__pyx_v_self)->__pyx_base.gid,__pyx_3,__pyx_4,__pyx_5,__pyx_6);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.GeomPlane.setParams");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_normal);
  Py_DECREF(__pyx_v_dist);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9GeomPlane_getParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_9GeomPlane_getParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector4 __pyx_v_res;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":195 */
  dGeomPlaneGetParams(((struct __pyx_obj_3ode_GeomPlane *)__pyx_v_self)->__pyx_base.gid,__pyx_v_res);

  /* "/home/zefiris/pyode/src/geoms.pyx":196 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 196; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 196; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 196; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 196; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[3])); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 196; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 196; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_1);
  __pyx_4 = 0;
  __pyx_1 = 0;
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.GeomPlane.getParams");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_9GeomPlane_pointDepth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_9GeomPlane_pointDepth[] = "pointDepth(p) -> float\n\n        Return the depth of the point p in the plane. Points inside the\n        geom will have positive depth, points outside it will have\n        negative depth, and points on the surface will have zero\n        depth.\n\n        @param p: Point\n        @type p: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_9GeomPlane_pointDepth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"p",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_p)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_p);

  /* "/home/zefiris/pyode/src/geoms.pyx":209 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 209; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 209; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 209; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 209; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 209; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 209; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 209; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 209; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 209; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyFloat_FromDouble(dGeomPlanePointDepth(((struct __pyx_obj_3ode_GeomPlane *)__pyx_v_self)->__pyx_base.gid,__pyx_3,__pyx_4,__pyx_5)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 209; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.GeomPlane.pointDepth");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static int __pyx_f_3ode_11GeomCapsule___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_11GeomCapsule___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_radius = 0;
  PyObject *__pyx_v_length = 0;
  struct __pyx_obj_3ode_SpaceBase *__pyx_v_sp;
  dSpaceID __pyx_v_sid;
  int __pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  dReal __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"space","radius","length",0};
  __pyx_v_space = __pyx_k46;
  __pyx_v_radius = __pyx_k47;
  __pyx_v_length = __pyx_k48;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_space, &__pyx_v_radius, &__pyx_v_length)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  Py_INCREF(__pyx_v_radius);
  Py_INCREF(__pyx_v_length);
  __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)Py_None); Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/geoms.pyx":230 */
  __pyx_v_sid = NULL;

  /* "/home/zefiris/pyode/src/geoms.pyx":231 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 231; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/geoms.pyx":232 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 232; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF(((PyObject *)__pyx_v_sp));
    __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_space);

    /* "/home/zefiris/pyode/src/geoms.pyx":233 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geoms.pyx":234 */
  __pyx_2 = PyFloat_AsDouble(__pyx_v_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 234; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_length); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 234; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_GeomCapsule *)__pyx_v_self)->__pyx_base.gid = dCreateCapsule(__pyx_v_sid,__pyx_2,__pyx_3);

  /* "/home/zefiris/pyode/src/geoms.pyx":238 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 238; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(((long )((struct __pyx_obj_3ode_GeomCapsule *)__pyx_v_self)->__pyx_base.gid)); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 238; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_4, __pyx_5, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 238; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("ode.GeomCapsule.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_sp);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  Py_DECREF(__pyx_v_radius);
  Py_DECREF(__pyx_v_length);
  return __pyx_r;
}

static int __pyx_f_3ode_11GeomCapsule___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_11GeomCapsule___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_radius = 0;
  PyObject *__pyx_v_length = 0;
  int __pyx_r;
  static char *__pyx_argnames[] = {"space","radius","length",0};
  __pyx_v_space = __pyx_k49;
  __pyx_v_radius = __pyx_k50;
  __pyx_v_length = __pyx_k51;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_space, &__pyx_v_radius, &__pyx_v_length)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  Py_INCREF(__pyx_v_radius);
  Py_INCREF(__pyx_v_length);

  /* "/home/zefiris/pyode/src/geoms.pyx":241 */
  Py_INCREF(__pyx_v_space);
  Py_DECREF(((struct __pyx_obj_3ode_GeomCapsule *)__pyx_v_self)->__pyx_base.space);
  ((struct __pyx_obj_3ode_GeomCapsule *)__pyx_v_self)->__pyx_base.space = __pyx_v_space;

  /* "/home/zefiris/pyode/src/geoms.pyx":242 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_3ode_GeomCapsule *)__pyx_v_self)->__pyx_base.body);
  ((struct __pyx_obj_3ode_GeomCapsule *)__pyx_v_self)->__pyx_base.body = Py_None;

  __pyx_r = 0;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  Py_DECREF(__pyx_v_radius);
  Py_DECREF(__pyx_v_length);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11GeomCapsule_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_11GeomCapsule_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":245 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 245; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomCapsule.placeable");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11GeomCapsule__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_11GeomCapsule__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_id;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":249 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomCapsule *)__pyx_v_self)->__pyx_base.gid);

  /* "/home/zefiris/pyode/src/geoms.pyx":250 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 250; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomCapsule._id");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11GeomCapsule_setParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_11GeomCapsule_setParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_radius = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"radius","length",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_radius, &__pyx_v_length)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_radius);
  Py_INCREF(__pyx_v_length);

  /* "/home/zefiris/pyode/src/geoms.pyx":253 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 253; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_length); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 253; goto __pyx_L1;}
  dGeomCapsuleSetParams(((struct __pyx_obj_3ode_GeomCapsule *)__pyx_v_self)->__pyx_base.gid,__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomCapsule.setParams");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_radius);
  Py_DECREF(__pyx_v_length);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11GeomCapsule_getParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_11GeomCapsule_getParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dReal __pyx_v_radius;
  dReal __pyx_v_length;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":257 */
  dGeomCapsuleGetParams(((struct __pyx_obj_3ode_GeomCapsule *)__pyx_v_self)->__pyx_base.gid,(&__pyx_v_radius),(&__pyx_v_length));

  /* "/home/zefiris/pyode/src/geoms.pyx":258 */
  __pyx_1 = PyFloat_FromDouble(__pyx_v_radius); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 258; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble(__pyx_v_length); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 258; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 258; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.GeomCapsule.getParams");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11GeomCapsule_pointDepth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11GeomCapsule_pointDepth[] = "pointDepth(p) -> float\n\n        Return the depth of the point p in the cylinder. Points inside the\n        geom will have positive depth, points outside it will have\n        negative depth, and points on the surface will have zero\n        depth.\n\n        @param p: Point\n        @type p: 3-sequence of floats\n        ";
static PyObject *__pyx_f_3ode_11GeomCapsule_pointDepth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"p",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_p)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_p);

  /* "/home/zefiris/pyode/src/geoms.pyx":271 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyFloat_FromDouble(dGeomCapsulePointDepth(((struct __pyx_obj_3ode_GeomCapsule *)__pyx_v_self)->__pyx_base.gid,__pyx_3,__pyx_4,__pyx_5)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.GeomCapsule.pointDepth");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static int __pyx_f_3ode_12GeomCylinder___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_12GeomCylinder___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_radius = 0;
  PyObject *__pyx_v_length = 0;
  struct __pyx_obj_3ode_SpaceBase *__pyx_v_sp;
  dSpaceID __pyx_v_sid;
  int __pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  dReal __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"space","radius","length",0};
  __pyx_v_space = __pyx_k52;
  __pyx_v_radius = __pyx_k53;
  __pyx_v_length = __pyx_k54;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_space, &__pyx_v_radius, &__pyx_v_length)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  Py_INCREF(__pyx_v_radius);
  Py_INCREF(__pyx_v_length);
  __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)Py_None); Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/geoms.pyx":292 */
  __pyx_v_sid = NULL;

  /* "/home/zefiris/pyode/src/geoms.pyx":293 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 293; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/geoms.pyx":294 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 294; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF(((PyObject *)__pyx_v_sp));
    __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_space);

    /* "/home/zefiris/pyode/src/geoms.pyx":295 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geoms.pyx":296 */
  __pyx_2 = PyFloat_AsDouble(__pyx_v_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 296; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_length); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 296; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_GeomCylinder *)__pyx_v_self)->__pyx_base.gid = dCreateCylinder(__pyx_v_sid,__pyx_2,__pyx_3);

  /* "/home/zefiris/pyode/src/geoms.pyx":300 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 300; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(((long )((struct __pyx_obj_3ode_GeomCylinder *)__pyx_v_self)->__pyx_base.gid)); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 300; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_4, __pyx_5, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 300; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("ode.GeomCylinder.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_sp);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  Py_DECREF(__pyx_v_radius);
  Py_DECREF(__pyx_v_length);
  return __pyx_r;
}

static int __pyx_f_3ode_12GeomCylinder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_12GeomCylinder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_radius = 0;
  PyObject *__pyx_v_length = 0;
  int __pyx_r;
  static char *__pyx_argnames[] = {"space","radius","length",0};
  __pyx_v_space = __pyx_k55;
  __pyx_v_radius = __pyx_k56;
  __pyx_v_length = __pyx_k57;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_space, &__pyx_v_radius, &__pyx_v_length)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  Py_INCREF(__pyx_v_radius);
  Py_INCREF(__pyx_v_length);

  /* "/home/zefiris/pyode/src/geoms.pyx":303 */
  Py_INCREF(__pyx_v_space);
  Py_DECREF(((struct __pyx_obj_3ode_GeomCylinder *)__pyx_v_self)->__pyx_base.space);
  ((struct __pyx_obj_3ode_GeomCylinder *)__pyx_v_self)->__pyx_base.space = __pyx_v_space;

  /* "/home/zefiris/pyode/src/geoms.pyx":304 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_3ode_GeomCylinder *)__pyx_v_self)->__pyx_base.body);
  ((struct __pyx_obj_3ode_GeomCylinder *)__pyx_v_self)->__pyx_base.body = Py_None;

  __pyx_r = 0;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  Py_DECREF(__pyx_v_radius);
  Py_DECREF(__pyx_v_length);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_12GeomCylinder_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_12GeomCylinder_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":307 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 307; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomCylinder.placeable");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_12GeomCylinder__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_12GeomCylinder__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_id;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":311 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomCylinder *)__pyx_v_self)->__pyx_base.gid);

  /* "/home/zefiris/pyode/src/geoms.pyx":312 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 312; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomCylinder._id");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_12GeomCylinder_setParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_12GeomCylinder_setParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_radius = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"radius","length",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_radius, &__pyx_v_length)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_radius);
  Py_INCREF(__pyx_v_length);

  /* "/home/zefiris/pyode/src/geoms.pyx":315 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 315; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_length); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 315; goto __pyx_L1;}
  dGeomCylinderSetParams(((struct __pyx_obj_3ode_GeomCylinder *)__pyx_v_self)->__pyx_base.gid,__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomCylinder.setParams");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_radius);
  Py_DECREF(__pyx_v_length);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_12GeomCylinder_getParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_12GeomCylinder_getParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dReal __pyx_v_radius;
  dReal __pyx_v_length;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":319 */
  dGeomCylinderGetParams(((struct __pyx_obj_3ode_GeomCylinder *)__pyx_v_self)->__pyx_base.gid,(&__pyx_v_radius),(&__pyx_v_length));

  /* "/home/zefiris/pyode/src/geoms.pyx":320 */
  __pyx_1 = PyFloat_FromDouble(__pyx_v_radius); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 320; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble(__pyx_v_length); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 320; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 320; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.GeomCylinder.getParams");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_3ode_7GeomRay___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_7GeomRay___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_rlen = 0;
  struct __pyx_obj_3ode_SpaceBase *__pyx_v_sp;
  dSpaceID __pyx_v_sid;
  int __pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"space","rlen",0};
  __pyx_v_space = __pyx_k58;
  __pyx_v_rlen = __pyx_k59;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_space, &__pyx_v_rlen)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  Py_INCREF(__pyx_v_rlen);
  __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)Py_None); Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/geoms.pyx":344 */
  __pyx_v_sid = NULL;

  /* "/home/zefiris/pyode/src/geoms.pyx":345 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 345; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/geoms.pyx":346 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 346; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF(((PyObject *)__pyx_v_sp));
    __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_space);

    /* "/home/zefiris/pyode/src/geoms.pyx":347 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geoms.pyx":348 */
  __pyx_2 = PyFloat_AsDouble(__pyx_v_rlen); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 348; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.gid = dCreateRay(__pyx_v_sid,__pyx_2);

  /* "/home/zefiris/pyode/src/geoms.pyx":352 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 352; goto __pyx_L1;}
  __pyx_4 = PyInt_FromLong(((long )((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.gid)); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 352; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_3, __pyx_4, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 352; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.GeomRay.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_sp);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  Py_DECREF(__pyx_v_rlen);
  return __pyx_r;
}

static int __pyx_f_3ode_7GeomRay___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_7GeomRay___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_rlen = 0;
  int __pyx_r;
  static char *__pyx_argnames[] = {"space","rlen",0};
  __pyx_v_space = __pyx_k60;
  __pyx_v_rlen = __pyx_k61;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_space, &__pyx_v_rlen)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  Py_INCREF(__pyx_v_rlen);

  /* "/home/zefiris/pyode/src/geoms.pyx":356 */
  Py_INCREF(__pyx_v_space);
  Py_DECREF(((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.space);
  ((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.space = __pyx_v_space;

  /* "/home/zefiris/pyode/src/geoms.pyx":357 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.body);
  ((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.body = Py_None;

  __pyx_r = 0;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  Py_DECREF(__pyx_v_rlen);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7GeomRay__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_7GeomRay__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_id;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":361 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.gid);

  /* "/home/zefiris/pyode/src/geoms.pyx":362 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 362; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomRay._id");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7GeomRay_setLength(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_7GeomRay_setLength(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_rlen = 0;
  PyObject *__pyx_r;
  dReal __pyx_1;
  static char *__pyx_argnames[] = {"rlen",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_rlen)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_rlen);

  /* "/home/zefiris/pyode/src/geoms.pyx":365 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_rlen); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 365; goto __pyx_L1;}
  dGeomRaySetLength(((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.gid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomRay.setLength");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_rlen);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7GeomRay_getLength(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_7GeomRay_getLength(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":368 */
  __pyx_1 = PyFloat_FromDouble(dGeomRayGetLength(((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 368; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomRay.getLength");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7GeomRay_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_7GeomRay_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_v_u = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  dReal __pyx_6;
  dReal __pyx_7;
  dReal __pyx_8;
  static char *__pyx_argnames[] = {"p","u",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_p, &__pyx_v_u)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_p);
  Py_INCREF(__pyx_v_u);

  /* "/home/zefiris/pyode/src/geoms.pyx":371 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_u, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_u, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_7 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_u, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_8 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dGeomRaySet(((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.gid,__pyx_3,__pyx_4,__pyx_5,__pyx_6,__pyx_7,__pyx_8);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.GeomRay.set");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_p);
  Py_DECREF(__pyx_v_u);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_7GeomRay_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_7GeomRay_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dVector3 __pyx_v_start;
  dVector3 __pyx_v_dir;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":376 */
  dGeomRayGet(((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.gid,__pyx_v_start,__pyx_v_dir);

  /* "/home/zefiris/pyode/src/geoms.pyx":377 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_start[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_start[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_start[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_1 = PyFloat_FromDouble((__pyx_v_dir[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_dir[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_dir[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_5, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_4);
  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_5);
  __pyx_4 = 0;
  __pyx_5 = 0;
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("ode.GeomRay.get");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_3ode_13GeomTransform___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_13GeomTransform___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  struct __pyx_obj_3ode_SpaceBase *__pyx_v_sp;
  dSpaceID __pyx_v_sid;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"space",0};
  __pyx_v_space = __pyx_k62;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);
  __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)Py_None); Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/geoms.pyx":399 */
  __pyx_v_sid = NULL;

  /* "/home/zefiris/pyode/src/geoms.pyx":400 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 400; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/geoms.pyx":401 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 401; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF(((PyObject *)__pyx_v_sp));
    __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_space);

    /* "/home/zefiris/pyode/src/geoms.pyx":402 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geoms.pyx":403 */
  ((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid = dCreateGeomTransform(__pyx_v_sid);

  /* "/home/zefiris/pyode/src/geoms.pyx":406 */
  dGeomTransformSetCleanup(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid,0);

  /* "/home/zefiris/pyode/src/geoms.pyx":410 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 410; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(((long )((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid)); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 410; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_2, __pyx_3, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 410; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.GeomTransform.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_sp);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  return __pyx_r;
}

static int __pyx_f_3ode_13GeomTransform___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_13GeomTransform___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {"space",0};
  __pyx_v_space = __pyx_k63;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_space);

  /* "/home/zefiris/pyode/src/geoms.pyx":413 */
  Py_INCREF(__pyx_v_space);
  Py_DECREF(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.space);
  ((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.space = __pyx_v_space;

  /* "/home/zefiris/pyode/src/geoms.pyx":414 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.body);
  ((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.body = Py_None;

  /* "/home/zefiris/pyode/src/geoms.pyx":415 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->geom);
  ((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->geom = Py_None;

  /* "/home/zefiris/pyode/src/geoms.pyx":417 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 417; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.attribs);
  ((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.attribs = __pyx_1;
  __pyx_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomTransform.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_13GeomTransform_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_13GeomTransform_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":420 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 420; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomTransform.placeable");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_13GeomTransform__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_13GeomTransform__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_id;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":424 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid);

  /* "/home/zefiris/pyode/src/geoms.pyx":425 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 425; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomTransform._id");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_k100p;
static PyObject *__pyx_k101p;
static PyObject *__pyx_k102p;

static char (__pyx_k100[]) = "Only placeable geoms can be encapsulated by a GeomTransform";
static char (__pyx_k101[]) = "The encapsulated geom was already inserted into a space.";
static char (__pyx_k102[]) = "The encapsulated geom is already associated with a body.";

static PyObject *__pyx_f_3ode_13GeomTransform_setGeom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_13GeomTransform_setGeom[] = "setGeom(geom)\n\n        Set the geom that the geometry transform encapsulates.\n        A ValueError exception is thrown if a) the geom is not placeable,\n        b) the geom was already inserted into a space or c) the geom is\n        already associated with a body.\n\n        @param geom: Geom object to encapsulate\n        @type geom: GeomObject\n        ";
static PyObject *__pyx_f_3ode_13GeomTransform_setGeom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_GeomObject *__pyx_v_geom = 0;
  long __pyx_v_id;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  int __pyx_4;
  long __pyx_5;
  static char *__pyx_argnames[] = {"geom",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_geom)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_geom);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_3ode_GeomObject, 0, "geom")) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 427; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/geoms.pyx":440 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_geom), __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 440; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 440; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyObject_IsTrue(__pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 440; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = (!__pyx_3);
  if (__pyx_4) {

    /* "/home/zefiris/pyode/src/geoms.pyx":441 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 441; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k100p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 441; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geoms.pyx":442 */
  __pyx_3 = (dGeomGetSpace(__pyx_v_geom->gid) != ((struct dxSpace (*))0));
  if (__pyx_3) {

    /* "/home/zefiris/pyode/src/geoms.pyx":443 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k101p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/zefiris/pyode/src/geoms.pyx":444 */
  __pyx_4 = (dGeomGetBody(__pyx_v_geom->gid) != ((struct dxBody (*))0));
  if (__pyx_4) {

    /* "/home/zefiris/pyode/src/geoms.pyx":445 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k102p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/zefiris/pyode/src/geoms.pyx":447 */
  __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_geom), __pyx_n__id); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 447; goto __pyx_L1;}
  __pyx_1 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 447; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 447; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_v_id = __pyx_5;

  /* "/home/zefiris/pyode/src/geoms.pyx":448 */
  dGeomTransformSetGeom(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid,((struct dxGeom (*))__pyx_v_id));

  /* "/home/zefiris/pyode/src/geoms.pyx":449 */
  Py_INCREF(((PyObject *)__pyx_v_geom));
  Py_DECREF(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->geom);
  ((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->geom = ((PyObject *)__pyx_v_geom);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.GeomTransform.setGeom");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_geom);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_13GeomTransform_getGeom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_13GeomTransform_getGeom[] = "getGeom() -> GeomObject\n\n        Get the geom that the geometry transform encapsulates.\n        ";
static PyObject *__pyx_f_3ode_13GeomTransform_getGeom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":456 */
  Py_INCREF(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->geom);
  __pyx_r = ((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->geom;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_k103p;

static char (__pyx_k103[]) = "Invalid information mode (%d). Must be either 0 or 1.";

static PyObject *__pyx_f_3ode_13GeomTransform_setInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_13GeomTransform_setInfo[] = "setInfo(mode)\n\n        Set the \"information\" mode of the geometry transform.\n\n        With mode 0, when a transform object is collided with another\n        object, the geom field of the ContactGeom structure is set to the\n        geom that is encapsulated by the transform object.\n\n        With mode 1, the geom field of the ContactGeom structure is set\n        to the transform object itself.\n\n        @param mode: Information mode (0 or 1)\n        @type mode: int\n        ";
static PyObject *__pyx_f_3ode_13GeomTransform_setInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_mode;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"mode",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_mode)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":473 */
  __pyx_1 = (__pyx_v_mode < 0);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_mode > 1);
  }
  if (__pyx_1) {

    /* "/home/zefiris/pyode/src/geoms.pyx":474 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 474; goto __pyx_L1;}
    __pyx_3 = PyInt_FromLong(__pyx_v_mode); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 474; goto __pyx_L1;}
    __pyx_4 = PyNumber_Remainder(__pyx_k103p, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 474; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __Pyx_Raise(__pyx_2, __pyx_4, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 474; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/geoms.pyx":475 */
  dGeomTransformSetInfo(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid,__pyx_v_mode);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.GeomTransform.setInfo");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_13GeomTransform_getInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_13GeomTransform_getInfo[] = "getInfo() -> int\n\n        Get the \"information\" mode of the geometry transform (0 or 1).\n\n        With mode 0, when a transform object is collided with another\n        object, the geom field of the ContactGeom structure is set to the\n        geom that is encapsulated by the transform object.\n\n        With mode 1, the geom field of the ContactGeom structure is set\n        to the transform object itself.\n        ";
static PyObject *__pyx_f_3ode_13GeomTransform_getInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/zefiris/pyode/src/geoms.pyx":489 */
  __pyx_1 = PyInt_FromLong(dGeomTransformGetInfo(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 489; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomTransform.getInfo");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_3ode_11TriMeshData___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_11TriMeshData___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1;
  Py_INCREF(__pyx_v_self);

  /* "src/trimeshdata.pyx":31 */
  ((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->tmdid = dGeomTriMeshDataCreate();

  /* "src/trimeshdata.pyx":32 */
  ((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->vertex_buffer = NULL;

  /* "src/trimeshdata.pyx":33 */
  ((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->face_buffer = NULL;

  __pyx_r = 0;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static void __pyx_f_3ode_11TriMeshData___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_f_3ode_11TriMeshData___dealloc__(PyObject *__pyx_v_self) {
  int __pyx_1;
  Py_INCREF(__pyx_v_self);

  /* "src/trimeshdata.pyx":36 */
  __pyx_1 = (((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->tmdid != NULL);
  if (__pyx_1) {

    /* "src/trimeshdata.pyx":37 */
    dGeomTriMeshDataDestroy(((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->tmdid);
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "src/trimeshdata.pyx":38 */
  __pyx_1 = (((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->vertex_buffer != NULL);
  if (__pyx_1) {

    /* "src/trimeshdata.pyx":39 */
    free(((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->vertex_buffer);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "src/trimeshdata.pyx":40 */
  __pyx_1 = (((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->face_buffer != NULL);
  if (__pyx_1) {

    /* "src/trimeshdata.pyx":41 */
    free(((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->face_buffer);
    goto __pyx_L4;
  }
  __pyx_L4:;

  Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_n_len;

static PyObject *__pyx_k104p;

static char (__pyx_k104[]) = "Vertex index out of range";

static PyObject *__pyx_f_3ode_11TriMeshData_build(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11TriMeshData_build[] = "build(verts, faces)\n\n        @param verts: Vertices\n        @type verts: Sequence of 3-sequences of floats\n        @param faces: Face definitions (three indices per face)\n        @type faces: Sequence of 3-sequences of ints\n        ";
static PyObject *__pyx_f_3ode_11TriMeshData_build(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_verts = 0;
  PyObject *__pyx_v_faces = 0;
  int __pyx_v_numverts;
  int __pyx_v_numfaces;
  dReal (*__pyx_v_vp);
  int (*__pyx_v_fp);
  int __pyx_v_a;
  int __pyx_v_b;
  int __pyx_v_c;
  PyObject *__pyx_v_v;
  PyObject *__pyx_v_f;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  dReal __pyx_5;
  static char *__pyx_argnames[] = {"verts","faces",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_verts, &__pyx_v_faces)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_verts);
  Py_INCREF(__pyx_v_faces);
  __pyx_v_v = Py_None; Py_INCREF(Py_None);
  __pyx_v_f = Py_None; Py_INCREF(Py_None);

  /* "src/trimeshdata.pyx":57 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 57; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 57; goto __pyx_L1;}
  Py_INCREF(__pyx_v_verts);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_verts);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 57; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 57; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_v_numverts = __pyx_4;

  /* "src/trimeshdata.pyx":58 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 58; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 58; goto __pyx_L1;}
  Py_INCREF(__pyx_v_faces);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_faces);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 58; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 58; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_v_numfaces = __pyx_4;

  /* "src/trimeshdata.pyx":60 */
  ((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->vertex_buffer = ((dReal (*))malloc(((__pyx_v_numverts * 4) * (sizeof(dReal )))));

  /* "src/trimeshdata.pyx":61 */
  ((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->face_buffer = ((int (*))malloc(((__pyx_v_numfaces * 3) * (sizeof(int )))));

  /* "src/trimeshdata.pyx":64 */
  __pyx_v_vp = ((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->vertex_buffer;

  /* "src/trimeshdata.pyx":65 */
  __pyx_1 = PyObject_GetIter(__pyx_v_verts); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; goto __pyx_L1;}
  for (;;) {
    __pyx_2 = PyIter_Next(__pyx_1);
    if (!__pyx_2) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; goto __pyx_L1;}
      break;
    }
    Py_DECREF(__pyx_v_v);
    __pyx_v_v = __pyx_2;
    __pyx_2 = 0;

    /* "src/trimeshdata.pyx":66 */
    __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 66; goto __pyx_L1;}
    __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 66; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 66; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    (__pyx_v_vp[0]) = __pyx_5;

    /* "src/trimeshdata.pyx":67 */
    __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 67; goto __pyx_L1;}
    __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 67; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 67; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    (__pyx_v_vp[1]) = __pyx_5;

    /* "src/trimeshdata.pyx":68 */
    __pyx_3 = PyInt_FromLong(2); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 68; goto __pyx_L1;}
    __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 68; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 68; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    (__pyx_v_vp[2]) = __pyx_5;

    /* "src/trimeshdata.pyx":69 */
    (__pyx_v_vp[3]) = 0;

    /* "src/trimeshdata.pyx":70 */
    __pyx_v_vp = (__pyx_v_vp + 4);
  }
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "src/trimeshdata.pyx":73 */
  __pyx_v_fp = ((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->face_buffer;

  /* "src/trimeshdata.pyx":74 */
  __pyx_3 = PyObject_GetIter(__pyx_v_faces); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 74; goto __pyx_L1;}
  for (;;) {
    __pyx_2 = PyIter_Next(__pyx_3);
    if (!__pyx_2) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 74; goto __pyx_L1;}
      break;
    }
    Py_DECREF(__pyx_v_f);
    __pyx_v_f = __pyx_2;
    __pyx_2 = 0;

    /* "src/trimeshdata.pyx":75 */
    __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 75; goto __pyx_L1;}
    __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 75; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 75; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_v_a = __pyx_4;

    /* "src/trimeshdata.pyx":76 */
    __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 76; goto __pyx_L1;}
    __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 76; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 76; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_v_b = __pyx_4;

    /* "src/trimeshdata.pyx":77 */
    __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 77; goto __pyx_L1;}
    __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 77; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 77; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_v_c = __pyx_4;

    /* "src/trimeshdata.pyx":78 */
    __pyx_4 = (__pyx_v_a < 0);
    if (!__pyx_4) {
      __pyx_4 = (__pyx_v_b < 0);
      if (!__pyx_4) {
        __pyx_4 = (__pyx_v_c < 0);
        if (!__pyx_4) {
          __pyx_4 = (__pyx_v_a >= __pyx_v_numverts);
          if (!__pyx_4) {
            __pyx_4 = (__pyx_v_b >= __pyx_v_numverts);
            if (!__pyx_4) {
              __pyx_4 = (__pyx_v_c >= __pyx_v_numverts);
            }
          }
        }
      }
    }
    if (__pyx_4) {

      /* "src/trimeshdata.pyx":79 */
      __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 79; goto __pyx_L1;}
      __Pyx_Raise(__pyx_1, __pyx_k104p, 0);
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 79; goto __pyx_L1;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "src/trimeshdata.pyx":80 */
    (__pyx_v_fp[0]) = __pyx_v_a;

    /* "src/trimeshdata.pyx":81 */
    (__pyx_v_fp[1]) = __pyx_v_b;

    /* "src/trimeshdata.pyx":82 */
    (__pyx_v_fp[2]) = __pyx_v_c;

    /* "src/trimeshdata.pyx":83 */
    __pyx_v_fp = (__pyx_v_fp + 3);
  }
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "src/trimeshdata.pyx":86 */
  dGeomTriMeshDataBuildSimple(((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->tmdid,((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->vertex_buffer,__pyx_v_numverts,((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->face_buffer,(__pyx_v_numfaces * 3));

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.TriMeshData.build");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_v);
  Py_DECREF(__pyx_v_f);
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_verts);
  Py_DECREF(__pyx_v_faces);
  return __pyx_r;
}

static int __pyx_f_3ode_11GeomTriMesh___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_11GeomTriMesh___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_TriMeshData *__pyx_v_data = 0;
  PyObject *__pyx_v_space = 0;
  struct __pyx_obj_3ode_SpaceBase *__pyx_v_sp;
  dSpaceID __pyx_v_sid;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"data","space",0};
  __pyx_v_space = __pyx_k64;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_data, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_data);
  Py_INCREF(__pyx_v_space);
  __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)Py_None); Py_INCREF(Py_None);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_3ode_TriMeshData, 0, "data")) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 41; goto __pyx_L1;}

  /* "src/trimesh.pyx":45 */
  Py_INCREF(((PyObject *)__pyx_v_data));
  Py_DECREF(((PyObject *)((struct __pyx_obj_3ode_GeomTriMesh *)__pyx_v_self)->data));
  ((struct __pyx_obj_3ode_GeomTriMesh *)__pyx_v_self)->data = __pyx_v_data;

  /* "src/trimesh.pyx":47 */
  __pyx_v_sid = NULL;

  /* "src/trimesh.pyx":48 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 48; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "src/trimesh.pyx":49 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 49; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF(((PyObject *)__pyx_v_sp));
    __pyx_v_sp = ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_space);

    /* "src/trimesh.pyx":50 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "src/trimesh.pyx":51 */
  ((struct __pyx_obj_3ode_GeomTriMesh *)__pyx_v_self)->__pyx_base.gid = dCreateTriMesh(__pyx_v_sid,__pyx_v_data->tmdid,NULL,NULL,NULL);

  /* "src/trimesh.pyx":53 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 53; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(((long )((struct __pyx_obj_3ode_GeomTriMesh *)__pyx_v_self)->__pyx_base.gid)); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 53; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_2, __pyx_3, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 53; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.GeomTriMesh.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_sp);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_data);
  Py_DECREF(__pyx_v_space);
  return __pyx_r;
}

static int __pyx_f_3ode_11GeomTriMesh___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_11GeomTriMesh___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_TriMeshData *__pyx_v_data = 0;
  PyObject *__pyx_v_space = 0;
  int __pyx_r;
  static char *__pyx_argnames[] = {"data","space",0};
  __pyx_v_space = __pyx_k65;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_data, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_data);
  Py_INCREF(__pyx_v_space);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_3ode_TriMeshData, 0, "data")) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 56; goto __pyx_L1;}

  /* "src/trimesh.pyx":57 */
  Py_INCREF(__pyx_v_space);
  Py_DECREF(((struct __pyx_obj_3ode_GeomTriMesh *)__pyx_v_self)->__pyx_base.space);
  ((struct __pyx_obj_3ode_GeomTriMesh *)__pyx_v_self)->__pyx_base.space = __pyx_v_space;

  /* "src/trimesh.pyx":58 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_3ode_GeomTriMesh *)__pyx_v_self)->__pyx_base.body);
  ((struct __pyx_obj_3ode_GeomTriMesh *)__pyx_v_self)->__pyx_base.body = Py_None;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomTriMesh.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_data);
  Py_DECREF(__pyx_v_space);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11GeomTriMesh_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_11GeomTriMesh_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "src/trimesh.pyx":61 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomTriMesh.placeable");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11GeomTriMesh__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_11GeomTriMesh__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_id;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "src/trimesh.pyx":65 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomTriMesh *)__pyx_v_self)->__pyx_base.gid);

  /* "src/trimesh.pyx":66 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 66; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomTriMesh._id");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11GeomTriMesh_clearTCCache(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11GeomTriMesh_clearTCCache[] = "clearTCCache()\n\n        Clears the internal temporal coherence caches.\n        ";
static PyObject *__pyx_f_3ode_11GeomTriMesh_clearTCCache(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "src/trimesh.pyx":73 */
  dGeomTriMeshClearTCCache(((struct __pyx_obj_3ode_GeomTriMesh *)__pyx_v_self)->__pyx_base.gid);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_11GeomTriMesh_getTriangle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_11GeomTriMesh_getTriangle[] = "getTriangle(idx) -> (v0, v1, v2)\n\n        @param idx: Triangle index\n        @type idx: int\n        ";
static PyObject *__pyx_f_3ode_11GeomTriMesh_getTriangle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_idx;
  dVector3 __pyx_v_v0;
  dVector3 __pyx_v_v1;
  dVector3 __pyx_v_v2;
  dVector3 (*__pyx_v_vp0);
  dVector3 (*__pyx_v_vp1);
  dVector3 (*__pyx_v_vp2);
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  static char *__pyx_argnames[] = {"idx",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_idx)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "src/trimesh.pyx":87 */
  __pyx_v_vp0 = ((dVector3 (*))__pyx_v_v0);

  /* "src/trimesh.pyx":88 */
  __pyx_v_vp1 = ((dVector3 (*))__pyx_v_v1);

  /* "src/trimesh.pyx":89 */
  __pyx_v_vp2 = ((dVector3 (*))__pyx_v_v2);

  /* "src/trimesh.pyx":91 */
  dGeomTriMeshGetTriangle(((struct __pyx_obj_3ode_GeomTriMesh *)__pyx_v_self)->__pyx_base.gid,__pyx_v_idx,__pyx_v_vp0,__pyx_v_vp1,__pyx_v_vp2);

  /* "src/trimesh.pyx":92 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_v0[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_v0[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_v0[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_1 = PyFloat_FromDouble((__pyx_v_v1[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_v1[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_v1[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_5, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_1 = PyFloat_FromDouble((__pyx_v_v2[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_v2[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_v2[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_6, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_6, 2, __pyx_3);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_1 = PyTuple_New(3); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_4);
  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_5);
  PyTuple_SET_ITEM(__pyx_1, 2, __pyx_6);
  __pyx_4 = 0;
  __pyx_5 = 0;
  __pyx_6 = 0;
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __Pyx_AddTraceback("ode.GeomTriMesh.getTriangle");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_collide(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_collide[] = "collide(geom1, geom2) -> contacts\n\n    Generate contact information for two objects.\n\n    Given two geometry objects that potentially touch (geom1 and geom2),\n    generate contact information for them. Internally, this just calls\n    the correct class-specific collision functions for geom1 and geom2.\n\n    [flags specifies how contacts should be generated if the objects\n    touch. Currently the lower 16 bits of flags specifies the maximum\n    number of contact points to generate. If this number is zero, this\n    function just pretends that it is one - in other words you can not\n    ask for zero contacts. All other bits in flags must be zero. In\n    the future the other bits may be used to select other contact\n    generation strategies.]\n\n    If the objects touch, this returns a list of Contact objects,\n    otherwise it returns an empty list.\n\n    @param geom1: First Geom\n    @type geom1: GeomObject\n    @param geom2: Second Geom\n    @type geom2: GeomObject\n    @returns: Returns a list of Contact objects.\n    ";
static PyObject *__pyx_f_3ode_collide(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_geom1 = 0;
  PyObject *__pyx_v_geom2 = 0;
  dContactGeom (__pyx_v_c[150]);
  long __pyx_v_id1;
  long __pyx_v_id2;
  int __pyx_v_i;
  int __pyx_v_n;
  struct __pyx_obj_3ode_Contact *__pyx_v_cont;
  PyObject *__pyx_v_res;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  long __pyx_3;
  int __pyx_4;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"geom1","geom2",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_geom1, &__pyx_v_geom2)) return 0;
  Py_INCREF(__pyx_v_geom1);
  Py_INCREF(__pyx_v_geom2);
  __pyx_v_cont = ((struct __pyx_obj_3ode_Contact *)Py_None); Py_INCREF(Py_None);
  __pyx_v_res = Py_None; Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/ode.pyx":219 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_geom1, __pyx_n__id); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 219; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 219; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 219; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_v_id1 = __pyx_3;

  /* "/home/zefiris/pyode/src/ode.pyx":220 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_geom2, __pyx_n__id); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 220; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 220; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 220; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_v_id2 = __pyx_3;

  /* "/home/zefiris/pyode/src/ode.pyx":222 */
  __pyx_v_n = dCollide(((struct dxGeom (*))__pyx_v_id1),((struct dxGeom (*))__pyx_v_id2),150,__pyx_v_c,(sizeof(dContactGeom )));

  /* "/home/zefiris/pyode/src/ode.pyx":223 */
  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 223; goto __pyx_L1;}
  Py_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_1;
  __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":224 */
  __pyx_v_i = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":225 */
  while (1) {
    __pyx_4 = (__pyx_v_i < __pyx_v_n);
    if (!__pyx_4) break;

    /* "/home/zefiris/pyode/src/ode.pyx":226 */
    __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_3ode_Contact), 0); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 226; goto __pyx_L1;}
    if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_3ode_Contact)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 226; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_cont));
    __pyx_v_cont = ((struct __pyx_obj_3ode_Contact *)__pyx_2);
    __pyx_2 = 0;

    /* "/home/zefiris/pyode/src/ode.pyx":227 */
    __pyx_v_cont->_contact.geom = (__pyx_v_c[__pyx_v_i]);

    /* "/home/zefiris/pyode/src/ode.pyx":228 */
    __pyx_1 = PyObject_GetAttr(__pyx_v_res, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 228; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 228; goto __pyx_L1;}
    Py_INCREF(((PyObject *)__pyx_v_cont));
    PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_cont));
    __pyx_5 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 228; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;

    /* "/home/zefiris/pyode/src/ode.pyx":229 */
    __pyx_v_i = (__pyx_v_i + 1);
  }

  /* "/home/zefiris/pyode/src/ode.pyx":231 */
  Py_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("ode.collide");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_cont);
  Py_DECREF(__pyx_v_res);
  Py_DECREF(__pyx_v_geom1);
  Py_DECREF(__pyx_v_geom2);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_collide2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_collide2[] = "collide2(geom1, geom2, arg, callback)\n    \n    Calls the callback for all potentially intersecting pairs that contain\n    one geom from geom1 and one geom from geom2.\n\n    @param geom1: First Geom\n    @type geom1: GeomObject\n    @param geom2: Second Geom\n    @type geom2: GeomObject\n    @param arg: A user argument that is passed to the callback function\n    @param callback: Callback function\n    @type callback: callable    \n    ";
static PyObject *__pyx_f_3ode_collide2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_geom1 = 0;
  PyObject *__pyx_v_geom2 = 0;
  PyObject *__pyx_v_arg = 0;
  PyObject *__pyx_v_callback = 0;
  void (*__pyx_v_data);
  PyObject *__pyx_v_tup;
  long __pyx_v_id1;
  long __pyx_v_id2;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  long __pyx_3;
  static char *__pyx_argnames[] = {"geom1","geom2","arg","callback",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO", __pyx_argnames, &__pyx_v_geom1, &__pyx_v_geom2, &__pyx_v_arg, &__pyx_v_callback)) return 0;
  Py_INCREF(__pyx_v_geom1);
  Py_INCREF(__pyx_v_geom2);
  Py_INCREF(__pyx_v_arg);
  Py_INCREF(__pyx_v_callback);
  __pyx_v_tup = Py_None; Py_INCREF(Py_None);

  /* "/home/zefiris/pyode/src/ode.pyx":252 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_geom1, __pyx_n__id); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 252; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 252; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 252; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_v_id1 = __pyx_3;

  /* "/home/zefiris/pyode/src/ode.pyx":253 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_geom2, __pyx_n__id); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 253; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 253; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 253; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_v_id2 = __pyx_3;

  /* "/home/zefiris/pyode/src/ode.pyx":255 */
  __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 255; goto __pyx_L1;}
  Py_INCREF(__pyx_v_callback);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_callback);
  Py_INCREF(__pyx_v_arg);
  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_arg);
  Py_DECREF(__pyx_v_tup);
  __pyx_v_tup = __pyx_1;
  __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":256 */
  __pyx_v_data = ((void (*))__pyx_v_tup);

  /* "/home/zefiris/pyode/src/ode.pyx":258 */
  dSpaceCollide2(((struct dxGeom (*))__pyx_v_id1),((struct dxGeom (*))__pyx_v_id2),__pyx_v_data,__pyx_f_3ode_collide_callback);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.collide2");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_tup);
  Py_DECREF(__pyx_v_geom1);
  Py_DECREF(__pyx_v_geom2);
  Py_DECREF(__pyx_v_arg);
  Py_DECREF(__pyx_v_callback);
  return __pyx_r;
}

static PyObject *__pyx_n_bool;

static PyObject *__pyx_f_3ode_areConnected(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_areConnected[] = "areConnected(body1, body2) -> bool\n\n    Return True if the two bodies are connected together by a joint,\n    otherwise return False.\n\n    @param body1: First body\n    @type body1: Body\n    @param body2: Second body\n    @type body2: Body\n    @returns: True if the bodies are connected\n    ";
static PyObject *__pyx_f_3ode_areConnected(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_3ode_Body *__pyx_v_body1 = 0;
  struct __pyx_obj_3ode_Body *__pyx_v_body2 = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"body1","body2",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_body1, &__pyx_v_body2)) return 0;
  Py_INCREF(__pyx_v_body1);
  Py_INCREF(__pyx_v_body2);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_body1), __pyx_ptype_3ode_Body, 1, "body1")) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 261; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_body2), __pyx_ptype_3ode_Body, 1, "body2")) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 261; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/ode.pyx":274 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_environment); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 274; goto __pyx_L1;}
  __pyx_2 = __pyx_v_body1 == __pyx_1;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/zefiris/pyode/src/ode.pyx":275 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 275; goto __pyx_L1;}
    __pyx_r = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/zefiris/pyode/src/ode.pyx":276 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_environment); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 276; goto __pyx_L1;}
  __pyx_2 = __pyx_v_body2 == __pyx_1;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/zefiris/pyode/src/ode.pyx":277 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 277; goto __pyx_L1;}
    __pyx_r = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/zefiris/pyode/src/ode.pyx":279 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_bool); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 279; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(dAreConnected(((struct dxBody (*))__pyx_v_body1->bid),((struct dxBody (*))__pyx_v_body2->bid))); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 279; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 279; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 279; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("ode.areConnected");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_body1);
  Py_DECREF(__pyx_v_body2);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_CloseODE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_CloseODE[] = "CloseODE()\n\n    Deallocate some extra memory used by ODE that can not be deallocated\n    using the normal destroy functions.\n    ";
static PyObject *__pyx_f_3ode_CloseODE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

  /* "/home/zefiris/pyode/src/ode.pyx":287 */
  dCloseODE();

  __pyx_r = Py_None; Py_INCREF(Py_None);
  return __pyx_r;
}

static __Pyx_InternTabEntry __pyx_intern_tab[] = {
  {&__pyx_n_AMotorEuler, "AMotorEuler"},
  {&__pyx_n_AMotorUser, "AMotorUser"},
  {&__pyx_n_AttributeError, "AttributeError"},
  {&__pyx_n_CloseODE, "CloseODE"},
  {&__pyx_n_ContactApprox0, "ContactApprox0"},
  {&__pyx_n_ContactApprox1, "ContactApprox1"},
  {&__pyx_n_ContactApprox1_1, "ContactApprox1_1"},
  {&__pyx_n_ContactApprox1_2, "ContactApprox1_2"},
  {&__pyx_n_ContactBounce, "ContactBounce"},
  {&__pyx_n_ContactFDir1, "ContactFDir1"},
  {&__pyx_n_ContactMotion1, "ContactMotion1"},
  {&__pyx_n_ContactMotion2, "ContactMotion2"},
  {&__pyx_n_ContactMu2, "ContactMu2"},
  {&__pyx_n_ContactSlip1, "ContactSlip1"},
  {&__pyx_n_ContactSlip2, "ContactSlip2"},
  {&__pyx_n_ContactSoftCFM, "ContactSoftCFM"},
  {&__pyx_n_ContactSoftERP, "ContactSoftERP"},
  {&__pyx_n_False, "False"},
  {&__pyx_n_GeomCCylinder, "GeomCCylinder"},
  {&__pyx_n_I, "I"},
  {&__pyx_n_IndexError, "IndexError"},
  {&__pyx_n_Infinity, "Infinity"},
  {&__pyx_n_MemoryError, "MemoryError"},
  {&__pyx_n_NotImplementedError, "NotImplementedError"},
  {&__pyx_n_ParamBounce, "ParamBounce"},
  {&__pyx_n_ParamBounce2, "ParamBounce2"},
  {&__pyx_n_ParamBounce3, "ParamBounce3"},
  {&__pyx_n_ParamCFM, "ParamCFM"},
  {&__pyx_n_ParamCFM2, "ParamCFM2"},
  {&__pyx_n_ParamCFM3, "ParamCFM3"},
  {&__pyx_n_ParamFMax, "ParamFMax"},
  {&__pyx_n_ParamFMax2, "ParamFMax2"},
  {&__pyx_n_ParamFMax3, "ParamFMax3"},
  {&__pyx_n_ParamFudgeFactor, "ParamFudgeFactor"},
  {&__pyx_n_ParamFudgeFactor2, "ParamFudgeFactor2"},
  {&__pyx_n_ParamFudgeFactor3, "ParamFudgeFactor3"},
  {&__pyx_n_ParamGroup, "ParamGroup"},
  {&__pyx_n_ParamHiStop, "ParamHiStop"},
  {&__pyx_n_ParamHiStop2, "ParamHiStop2"},
  {&__pyx_n_ParamHiStop3, "ParamHiStop3"},
  {&__pyx_n_ParamLoStop, "ParamLoStop"},
  {&__pyx_n_ParamLoStop2, "ParamLoStop2"},
  {&__pyx_n_ParamLoStop3, "ParamLoStop3"},
  {&__pyx_n_ParamStopCFM, "ParamStopCFM"},
  {&__pyx_n_ParamStopCFM2, "ParamStopCFM2"},
  {&__pyx_n_ParamStopCFM3, "ParamStopCFM3"},
  {&__pyx_n_ParamStopERP, "ParamStopERP"},
  {&__pyx_n_ParamStopERP2, "ParamStopERP2"},
  {&__pyx_n_ParamStopERP3, "ParamStopERP3"},
  {&__pyx_n_ParamSuspensionCFM, "ParamSuspensionCFM"},
  {&__pyx_n_ParamSuspensionCFM2, "ParamSuspensionCFM2"},
  {&__pyx_n_ParamSuspensionCFM3, "ParamSuspensionCFM3"},
  {&__pyx_n_ParamSuspensionERP, "ParamSuspensionERP"},
  {&__pyx_n_ParamSuspensionERP2, "ParamSuspensionERP2"},
  {&__pyx_n_ParamSuspensionERP3, "ParamSuspensionERP3"},
  {&__pyx_n_ParamVel, "ParamVel"},
  {&__pyx_n_ParamVel2, "ParamVel2"},
  {&__pyx_n_ParamVel3, "ParamVel3"},
  {&__pyx_n_RuntimeError, "RuntimeError"},
  {&__pyx_n_Space, "Space"},
  {&__pyx_n_StopIteration, "StopIteration"},
  {&__pyx_n_True, "True"},
  {&__pyx_n_ValueError, "ValueError"},
  {&__pyx_n__SpaceIterator, "_SpaceIterator"},
  {&__pyx_n___doc__, "__doc__"},
  {&__pyx_n___init__, "__init__"},
  {&__pyx_n___iter__, "__iter__"},
  {&__pyx_n__addjoint, "_addjoint"},
  {&__pyx_n__destroyed, "_destroyed"},
  {&__pyx_n__geom_c2py_lut, "_geom_c2py_lut"},
  {&__pyx_n__id, "_id"},
  {&__pyx_n_add, "add"},
  {&__pyx_n_adjust, "adjust"},
  {&__pyx_n_append, "append"},
  {&__pyx_n_areConnected, "areConnected"},
  {&__pyx_n_bool, "bool"},
  {&__pyx_n_c, "c"},
  {&__pyx_n_collide, "collide"},
  {&__pyx_n_collide2, "collide2"},
  {&__pyx_n_environment, "environment"},
  {&__pyx_n_getGeom, "getGeom"},
  {&__pyx_n_getNumGeoms, "getNumGeoms"},
  {&__pyx_n_idx, "idx"},
  {&__pyx_n_len, "len"},
  {&__pyx_n_long, "long"},
  {&__pyx_n_mass, "mass"},
  {&__pyx_n_next, "next"},
  {&__pyx_n_paramBounce, "paramBounce"},
  {&__pyx_n_paramCFM, "paramCFM"},
  {&__pyx_n_paramFMax, "paramFMax"},
  {&__pyx_n_paramFudgeFactor, "paramFudgeFactor"},
  {&__pyx_n_paramHiStop, "paramHiStop"},
  {&__pyx_n_paramLoStop, "paramLoStop"},
  {&__pyx_n_paramStopCFM, "paramStopCFM"},
  {&__pyx_n_paramStopERP, "paramStopERP"},
  {&__pyx_n_paramSuspensionCFM, "paramSuspensionCFM"},
  {&__pyx_n_paramSuspensionERP, "paramSuspensionERP"},
  {&__pyx_n_paramVel, "paramVel"},
  {&__pyx_n_placeable, "placeable"},
  {&__pyx_n_setFeedback, "setFeedback"},
  {&__pyx_n_space, "space"},
  {&__pyx_n_str, "str"},
  {0, 0}
};

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_k1p, __pyx_k1, sizeof(__pyx_k1)},
  {&__pyx_k24p, __pyx_k24, sizeof(__pyx_k24)},
  {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)},
  {&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)},
  {&__pyx_k73p, __pyx_k73, sizeof(__pyx_k73)},
  {&__pyx_k75p, __pyx_k75, sizeof(__pyx_k75)},
  {&__pyx_k76p, __pyx_k76, sizeof(__pyx_k76)},
  {&__pyx_k77p, __pyx_k77, sizeof(__pyx_k77)},
  {&__pyx_k78p, __pyx_k78, sizeof(__pyx_k78)},
  {&__pyx_k79p, __pyx_k79, sizeof(__pyx_k79)},
  {&__pyx_k80p, __pyx_k80, sizeof(__pyx_k80)},
  {&__pyx_k81p, __pyx_k81, sizeof(__pyx_k81)},
  {&__pyx_k82p, __pyx_k82, sizeof(__pyx_k82)},
  {&__pyx_k83p, __pyx_k83, sizeof(__pyx_k83)},
  {&__pyx_k84p, __pyx_k84, sizeof(__pyx_k84)},
  {&__pyx_k85p, __pyx_k85, sizeof(__pyx_k85)},
  {&__pyx_k86p, __pyx_k86, sizeof(__pyx_k86)},
  {&__pyx_k87p, __pyx_k87, sizeof(__pyx_k87)},
  {&__pyx_k88p, __pyx_k88, sizeof(__pyx_k88)},
  {&__pyx_k89p, __pyx_k89, sizeof(__pyx_k89)},
  {&__pyx_k90p, __pyx_k90, sizeof(__pyx_k90)},
  {&__pyx_k91p, __pyx_k91, sizeof(__pyx_k91)},
  {&__pyx_k92p, __pyx_k92, sizeof(__pyx_k92)},
  {&__pyx_k93p, __pyx_k93, sizeof(__pyx_k93)},
  {&__pyx_k94p, __pyx_k94, sizeof(__pyx_k94)},
  {&__pyx_k95p, __pyx_k95, sizeof(__pyx_k95)},
  {&__pyx_k96p, __pyx_k96, sizeof(__pyx_k96)},
  {&__pyx_k97p, __pyx_k97, sizeof(__pyx_k97)},
  {&__pyx_k98p, __pyx_k98, sizeof(__pyx_k98)},
  {&__pyx_k99p, __pyx_k99, sizeof(__pyx_k99)},
  {&__pyx_k100p, __pyx_k100, sizeof(__pyx_k100)},
  {&__pyx_k101p, __pyx_k101, sizeof(__pyx_k101)},
  {&__pyx_k102p, __pyx_k102, sizeof(__pyx_k102)},
  {&__pyx_k103p, __pyx_k103, sizeof(__pyx_k103)},
  {&__pyx_k104p, __pyx_k104, sizeof(__pyx_k104)},
  {0, 0, 0}
};

static PyObject *__pyx_tp_new_3ode_Mass(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (__pyx_f_3ode_4Mass___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_Mass(PyObject *o) {
  (*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_3ode_Mass(PyObject *o, visitproc v, void *a) {
  return 0;
}

static int __pyx_tp_clear_3ode_Mass(PyObject *o) {
  return 0;
}

static PyObject *__pyx_tp_getattro_3ode_Mass(PyObject *o, PyObject *n) {
  PyObject *v = PyObject_GenericGetAttr(o, n);
  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
    PyErr_Clear();
    v = __pyx_f_3ode_4Mass___getattr__(o, n);
  }
  return v;
}

static int __pyx_tp_setattro_3ode_Mass(PyObject *o, PyObject *n, PyObject *v) {
  if (v) {
    return __pyx_f_3ode_4Mass___setattr__(o, n, v);
  }
  else {
    return PyObject_GenericSetAttr(o, n, 0);
  }
}

static struct PyMethodDef __pyx_methods_3ode_Mass[] = {
  {"setZero", (PyCFunction)__pyx_f_3ode_4Mass_setZero, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_setZero},
  {"setParameters", (PyCFunction)__pyx_f_3ode_4Mass_setParameters, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_setParameters},
  {"setSphere", (PyCFunction)__pyx_f_3ode_4Mass_setSphere, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_setSphere},
  {"setSphereTotal", (PyCFunction)__pyx_f_3ode_4Mass_setSphereTotal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_setSphereTotal},
  {"setCappedCylinder", (PyCFunction)__pyx_f_3ode_4Mass_setCappedCylinder, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_setCappedCylinder},
  {"setCappedCylinderTotal", (PyCFunction)__pyx_f_3ode_4Mass_setCappedCylinderTotal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_setCappedCylinderTotal},
  {"setCylinder", (PyCFunction)__pyx_f_3ode_4Mass_setCylinder, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_setCylinder},
  {"setCylinderTotal", (PyCFunction)__pyx_f_3ode_4Mass_setCylinderTotal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_setCylinderTotal},
  {"setBox", (PyCFunction)__pyx_f_3ode_4Mass_setBox, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_setBox},
  {"setBoxTotal", (PyCFunction)__pyx_f_3ode_4Mass_setBoxTotal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_setBoxTotal},
  {"adjust", (PyCFunction)__pyx_f_3ode_4Mass_adjust, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_adjust},
  {"translate", (PyCFunction)__pyx_f_3ode_4Mass_translate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_translate},
  {"add", (PyCFunction)__pyx_f_3ode_4Mass_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_add},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Mass = {
  __pyx_f_3ode_4Mass___add__, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_Mass = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Mass = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Mass = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_Mass = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.Mass", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_Mass), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_Mass, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_Mass, /*tp_as_number*/
  &__pyx_tp_as_sequence_Mass, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Mass, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_f_3ode_4Mass___str__, /*tp_str*/
  __pyx_tp_getattro_3ode_Mass, /*tp_getattro*/
  __pyx_tp_setattro_3ode_Mass, /*tp_setattro*/
  &__pyx_tp_as_buffer_Mass, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Mass parameters of a rigid body.\n\n    This class stores mass parameters of a rigid body which can be\n    accessed through the following attributes:\n\n     - mass: The total mass of the body (float)\n     - c:    The center of gravity position in body frame (3-tuple of floats)\n     - I:    The 3x3 inertia tensor in body frame (3-tuple of 3-tuples)\n\n    This class wraps the dMass structure from the C API.\n\n    @ivar mass: The total mass of the body\n    @ivar c: The center of gravity position in body frame (cx, cy, cz)\n    @ivar I: The 3x3 inertia tensor in body frame ((I11, I12, I13), (I12, I22, I23), (I13, I23, I33))\n    @type mass: float\n    @type c: 3-tuple of floats\n    @type I: 3-tuple of 3-tuples of floats \n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_Mass, /*tp_traverse*/
  __pyx_tp_clear_3ode_Mass, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_Mass, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_Mass, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_Contact(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (__pyx_f_3ode_7Contact___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_Contact(PyObject *o) {
  (*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_3ode_Contact(PyObject *o, visitproc v, void *a) {
  return 0;
}

static int __pyx_tp_clear_3ode_Contact(PyObject *o) {
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_Contact[] = {
  {"getMode", (PyCFunction)__pyx_f_3ode_7Contact_getMode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_getMode},
  {"setMode", (PyCFunction)__pyx_f_3ode_7Contact_setMode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_setMode},
  {"getMu", (PyCFunction)__pyx_f_3ode_7Contact_getMu, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_getMu},
  {"setMu", (PyCFunction)__pyx_f_3ode_7Contact_setMu, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_setMu},
  {"getMu2", (PyCFunction)__pyx_f_3ode_7Contact_getMu2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_getMu2},
  {"setMu2", (PyCFunction)__pyx_f_3ode_7Contact_setMu2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_setMu2},
  {"getBounce", (PyCFunction)__pyx_f_3ode_7Contact_getBounce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_getBounce},
  {"setBounce", (PyCFunction)__pyx_f_3ode_7Contact_setBounce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_setBounce},
  {"getBounceVel", (PyCFunction)__pyx_f_3ode_7Contact_getBounceVel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_getBounceVel},
  {"setBounceVel", (PyCFunction)__pyx_f_3ode_7Contact_setBounceVel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_setBounceVel},
  {"getSoftERP", (PyCFunction)__pyx_f_3ode_7Contact_getSoftERP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_getSoftERP},
  {"setSoftERP", (PyCFunction)__pyx_f_3ode_7Contact_setSoftERP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_setSoftERP},
  {"getSoftCFM", (PyCFunction)__pyx_f_3ode_7Contact_getSoftCFM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_getSoftCFM},
  {"setSoftCFM", (PyCFunction)__pyx_f_3ode_7Contact_setSoftCFM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_setSoftCFM},
  {"getMotion1", (PyCFunction)__pyx_f_3ode_7Contact_getMotion1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_getMotion1},
  {"setMotion1", (PyCFunction)__pyx_f_3ode_7Contact_setMotion1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_setMotion1},
  {"getMotion2", (PyCFunction)__pyx_f_3ode_7Contact_getMotion2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_getMotion2},
  {"setMotion2", (PyCFunction)__pyx_f_3ode_7Contact_setMotion2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_setMotion2},
  {"getSlip1", (PyCFunction)__pyx_f_3ode_7Contact_getSlip1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_getSlip1},
  {"setSlip1", (PyCFunction)__pyx_f_3ode_7Contact_setSlip1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_setSlip1},
  {"getSlip2", (PyCFunction)__pyx_f_3ode_7Contact_getSlip2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_getSlip2},
  {"setSlip2", (PyCFunction)__pyx_f_3ode_7Contact_setSlip2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_setSlip2},
  {"getFDir1", (PyCFunction)__pyx_f_3ode_7Contact_getFDir1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_getFDir1},
  {"setFDir1", (PyCFunction)__pyx_f_3ode_7Contact_setFDir1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_setFDir1},
  {"getContactGeomParams", (PyCFunction)__pyx_f_3ode_7Contact_getContactGeomParams, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_getContactGeomParams},
  {"setContactGeomParams", (PyCFunction)__pyx_f_3ode_7Contact_setContactGeomParams, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7Contact_setContactGeomParams},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Contact = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_Contact = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Contact = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Contact = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_Contact = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.Contact", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_Contact), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_Contact, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_Contact, /*tp_as_number*/
  &__pyx_tp_as_sequence_Contact, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Contact, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Contact, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "This class represents a contact between two bodies in one point.\n\n    A Contact object stores all the input parameters for a ContactJoint.\n    This class wraps the ODE dContact structure which has 3 components::\n\n     struct dContact {\n       dSurfaceParameters surface;\n       dContactGeom geom;\n       dVector3 fdir1;\n     };    \n\n    This wrapper class provides methods to get and set the items of those\n    structures.\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_Contact, /*tp_traverse*/
  __pyx_tp_clear_3ode_Contact, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_Contact, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_Contact, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_World(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (__pyx_f_3ode_5World___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_World(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_3ode_5World___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  (*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_3ode_World(PyObject *o, visitproc v, void *a) {
  return 0;
}

static int __pyx_tp_clear_3ode_World(PyObject *o) {
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_World[] = {
  {"setGravity", (PyCFunction)__pyx_f_3ode_5World_setGravity, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_setGravity},
  {"getGravity", (PyCFunction)__pyx_f_3ode_5World_getGravity, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_getGravity},
  {"setERP", (PyCFunction)__pyx_f_3ode_5World_setERP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_setERP},
  {"getERP", (PyCFunction)__pyx_f_3ode_5World_getERP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_getERP},
  {"setCFM", (PyCFunction)__pyx_f_3ode_5World_setCFM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_setCFM},
  {"getCFM", (PyCFunction)__pyx_f_3ode_5World_getCFM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_getCFM},
  {"step", (PyCFunction)__pyx_f_3ode_5World_step, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_step},
  {"quickStep", (PyCFunction)__pyx_f_3ode_5World_quickStep, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_quickStep},
  {"setQuickStepNumIterations", (PyCFunction)__pyx_f_3ode_5World_setQuickStepNumIterations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_setQuickStepNumIterations},
  {"getQuickStepNumIterations", (PyCFunction)__pyx_f_3ode_5World_getQuickStepNumIterations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_getQuickStepNumIterations},
  {"setContactMaxCorrectingVel", (PyCFunction)__pyx_f_3ode_5World_setContactMaxCorrectingVel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_setContactMaxCorrectingVel},
  {"getContactMaxCorrectingVel", (PyCFunction)__pyx_f_3ode_5World_getContactMaxCorrectingVel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_getContactMaxCorrectingVel},
  {"setContactSurfaceLayer", (PyCFunction)__pyx_f_3ode_5World_setContactSurfaceLayer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_setContactSurfaceLayer},
  {"getContactSurfaceLayer", (PyCFunction)__pyx_f_3ode_5World_getContactSurfaceLayer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_getContactSurfaceLayer},
  {"setAutoDisableFlag", (PyCFunction)__pyx_f_3ode_5World_setAutoDisableFlag, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_setAutoDisableFlag},
  {"getAutoDisableFlag", (PyCFunction)__pyx_f_3ode_5World_getAutoDisableFlag, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_getAutoDisableFlag},
  {"setAutoDisableLinearThreshold", (PyCFunction)__pyx_f_3ode_5World_setAutoDisableLinearThreshold, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_setAutoDisableLinearThreshold},
  {"getAutoDisableLinearThreshold", (PyCFunction)__pyx_f_3ode_5World_getAutoDisableLinearThreshold, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_getAutoDisableLinearThreshold},
  {"setAutoDisableAngularThreshold", (PyCFunction)__pyx_f_3ode_5World_setAutoDisableAngularThreshold, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_setAutoDisableAngularThreshold},
  {"getAutoDisableAngularThreshold", (PyCFunction)__pyx_f_3ode_5World_getAutoDisableAngularThreshold, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_getAutoDisableAngularThreshold},
  {"setAutoDisableSteps", (PyCFunction)__pyx_f_3ode_5World_setAutoDisableSteps, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_setAutoDisableSteps},
  {"getAutoDisableSteps", (PyCFunction)__pyx_f_3ode_5World_getAutoDisableSteps, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_getAutoDisableSteps},
  {"setAutoDisableTime", (PyCFunction)__pyx_f_3ode_5World_setAutoDisableTime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_setAutoDisableTime},
  {"getAutoDisableTime", (PyCFunction)__pyx_f_3ode_5World_getAutoDisableTime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_getAutoDisableTime},
  {"impulseToForce", (PyCFunction)__pyx_f_3ode_5World_impulseToForce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5World_impulseToForce},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_World = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_World = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_World = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_World = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_World = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.World", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_World), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_World, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_World, /*tp_as_number*/
  &__pyx_tp_as_sequence_World, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_World, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_World, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Dynamics world.\n    \n    The world object is a container for rigid bodies and joints.\n    \n    \n    Constructor::\n    \n      World()\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_World, /*tp_traverse*/
  __pyx_tp_clear_3ode_World, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_World, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_World, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_Body(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  struct __pyx_obj_3ode_Body *p = (struct __pyx_obj_3ode_Body *)o;
  p->world = Py_None; Py_INCREF(Py_None);
  p->userattribs = Py_None; Py_INCREF(Py_None);
  if (__pyx_f_3ode_4Body___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_Body(PyObject *o) {
  struct __pyx_obj_3ode_Body *p = (struct __pyx_obj_3ode_Body *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_3ode_4Body___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(p->world);
  Py_XDECREF(p->userattribs);
  (*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_3ode_Body(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_Body *p = (struct __pyx_obj_3ode_Body *)o;
  if (p->world) {
    e = (*v)(p->world, a); if (e) return e;
  }
  if (p->userattribs) {
    e = (*v)(p->userattribs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3ode_Body(PyObject *o) {
  struct __pyx_obj_3ode_Body *p = (struct __pyx_obj_3ode_Body *)o;
  Py_XDECREF(p->world);
  p->world = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(p->userattribs);
  p->userattribs = Py_None; Py_INCREF(Py_None);
  return 0;
}

static PyObject *__pyx_tp_getattro_3ode_Body(PyObject *o, PyObject *n) {
  PyObject *v = PyObject_GenericGetAttr(o, n);
  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
    PyErr_Clear();
    v = __pyx_f_3ode_4Body___getattr__(o, n);
  }
  return v;
}

static int __pyx_tp_setattro_3ode_Body(PyObject *o, PyObject *n, PyObject *v) {
  if (v) {
    return __pyx_f_3ode_4Body___setattr__(o, n, v);
  }
  else {
    return __pyx_f_3ode_4Body___delattr__(o, n);
  }
}

static struct PyMethodDef __pyx_methods_3ode_Body[] = {
  {"setPosition", (PyCFunction)__pyx_f_3ode_4Body_setPosition, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_setPosition},
  {"getPosition", (PyCFunction)__pyx_f_3ode_4Body_getPosition, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getPosition},
  {"setRotation", (PyCFunction)__pyx_f_3ode_4Body_setRotation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_setRotation},
  {"getRotation", (PyCFunction)__pyx_f_3ode_4Body_getRotation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getRotation},
  {"getQuaternion", (PyCFunction)__pyx_f_3ode_4Body_getQuaternion, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getQuaternion},
  {"setQuaternion", (PyCFunction)__pyx_f_3ode_4Body_setQuaternion, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_setQuaternion},
  {"setLinearVel", (PyCFunction)__pyx_f_3ode_4Body_setLinearVel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_setLinearVel},
  {"getLinearVel", (PyCFunction)__pyx_f_3ode_4Body_getLinearVel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getLinearVel},
  {"setAngularVel", (PyCFunction)__pyx_f_3ode_4Body_setAngularVel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_setAngularVel},
  {"getAngularVel", (PyCFunction)__pyx_f_3ode_4Body_getAngularVel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getAngularVel},
  {"setMass", (PyCFunction)__pyx_f_3ode_4Body_setMass, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_setMass},
  {"getMass", (PyCFunction)__pyx_f_3ode_4Body_getMass, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getMass},
  {"addForce", (PyCFunction)__pyx_f_3ode_4Body_addForce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_addForce},
  {"addTorque", (PyCFunction)__pyx_f_3ode_4Body_addTorque, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_addTorque},
  {"addRelForce", (PyCFunction)__pyx_f_3ode_4Body_addRelForce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_addRelForce},
  {"addRelTorque", (PyCFunction)__pyx_f_3ode_4Body_addRelTorque, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_addRelTorque},
  {"addForceAtPos", (PyCFunction)__pyx_f_3ode_4Body_addForceAtPos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_addForceAtPos},
  {"addForceAtRelPos", (PyCFunction)__pyx_f_3ode_4Body_addForceAtRelPos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_addForceAtRelPos},
  {"addRelForceAtPos", (PyCFunction)__pyx_f_3ode_4Body_addRelForceAtPos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_addRelForceAtPos},
  {"addRelForceAtRelPos", (PyCFunction)__pyx_f_3ode_4Body_addRelForceAtRelPos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_addRelForceAtRelPos},
  {"getForce", (PyCFunction)__pyx_f_3ode_4Body_getForce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getForce},
  {"getTorque", (PyCFunction)__pyx_f_3ode_4Body_getTorque, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getTorque},
  {"setForce", (PyCFunction)__pyx_f_3ode_4Body_setForce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_setForce},
  {"setTorque", (PyCFunction)__pyx_f_3ode_4Body_setTorque, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_setTorque},
  {"getRelPointPos", (PyCFunction)__pyx_f_3ode_4Body_getRelPointPos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getRelPointPos},
  {"getRelPointVel", (PyCFunction)__pyx_f_3ode_4Body_getRelPointVel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getRelPointVel},
  {"getPointVel", (PyCFunction)__pyx_f_3ode_4Body_getPointVel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getPointVel},
  {"getPosRelPoint", (PyCFunction)__pyx_f_3ode_4Body_getPosRelPoint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getPosRelPoint},
  {"vectorToWorld", (PyCFunction)__pyx_f_3ode_4Body_vectorToWorld, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_vectorToWorld},
  {"vectorFromWorld", (PyCFunction)__pyx_f_3ode_4Body_vectorFromWorld, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_vectorFromWorld},
  {"enable", (PyCFunction)__pyx_f_3ode_4Body_enable, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_enable},
  {"disable", (PyCFunction)__pyx_f_3ode_4Body_disable, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_disable},
  {"isEnabled", (PyCFunction)__pyx_f_3ode_4Body_isEnabled, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_isEnabled},
  {"setFiniteRotationMode", (PyCFunction)__pyx_f_3ode_4Body_setFiniteRotationMode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_setFiniteRotationMode},
  {"getFiniteRotationMode", (PyCFunction)__pyx_f_3ode_4Body_getFiniteRotationMode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getFiniteRotationMode},
  {"setFiniteRotationAxis", (PyCFunction)__pyx_f_3ode_4Body_setFiniteRotationAxis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_setFiniteRotationAxis},
  {"getFiniteRotationAxis", (PyCFunction)__pyx_f_3ode_4Body_getFiniteRotationAxis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getFiniteRotationAxis},
  {"getNumJoints", (PyCFunction)__pyx_f_3ode_4Body_getNumJoints, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getNumJoints},
  {"setGravityMode", (PyCFunction)__pyx_f_3ode_4Body_setGravityMode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_setGravityMode},
  {"getGravityMode", (PyCFunction)__pyx_f_3ode_4Body_getGravityMode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Body_getGravityMode},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Body = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_Body = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Body = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Body = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_Body = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.Body", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_Body), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_Body, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_Body, /*tp_as_number*/
  &__pyx_tp_as_sequence_Body, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Body, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  __pyx_tp_getattro_3ode_Body, /*tp_getattro*/
  __pyx_tp_setattro_3ode_Body, /*tp_setattro*/
  &__pyx_tp_as_buffer_Body, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "The rigid body class encapsulating the ODE body.\n\n    This class represents a rigid body that has a location and orientation\n    in space and that stores the mass properties of an object.\n\n    When creating a Body object you have to pass the world it belongs to\n    as argument to the constructor::\n\n      >>> import ode\n      >>> w = ode.World()\n      >>> b = ode.Body(w)\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_Body, /*tp_traverse*/
  __pyx_tp_clear_3ode_Body, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_Body, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_4Body___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_Body, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_JointGroup(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  struct __pyx_obj_3ode_JointGroup *p = (struct __pyx_obj_3ode_JointGroup *)o;
  p->jointlist = Py_None; Py_INCREF(Py_None);
  if (__pyx_f_3ode_10JointGroup___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_JointGroup(PyObject *o) {
  struct __pyx_obj_3ode_JointGroup *p = (struct __pyx_obj_3ode_JointGroup *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_3ode_10JointGroup___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(p->jointlist);
  (*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_3ode_JointGroup(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_JointGroup *p = (struct __pyx_obj_3ode_JointGroup *)o;
  if (p->jointlist) {
    e = (*v)(p->jointlist, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3ode_JointGroup(PyObject *o) {
  struct __pyx_obj_3ode_JointGroup *p = (struct __pyx_obj_3ode_JointGroup *)o;
  Py_XDECREF(p->jointlist);
  p->jointlist = Py_None; Py_INCREF(Py_None);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_JointGroup[] = {
  {"empty", (PyCFunction)__pyx_f_3ode_10JointGroup_empty, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10JointGroup_empty},
  {"_addjoint", (PyCFunction)__pyx_f_3ode_10JointGroup__addjoint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10JointGroup__addjoint},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_JointGroup = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_JointGroup = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_JointGroup = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_JointGroup = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_JointGroup = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.JointGroup", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_JointGroup), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_JointGroup, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_JointGroup, /*tp_as_number*/
  &__pyx_tp_as_sequence_JointGroup, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_JointGroup, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_JointGroup, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Joint group.\n\n    Constructor::\n    \n      JointGroup()    \n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_JointGroup, /*tp_traverse*/
  __pyx_tp_clear_3ode_JointGroup, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_JointGroup, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_10JointGroup___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_JointGroup, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_Joint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  struct __pyx_obj_3ode_Joint *p = (struct __pyx_obj_3ode_Joint *)o;
  p->world = Py_None; Py_INCREF(Py_None);
  p->body1 = Py_None; Py_INCREF(Py_None);
  p->body2 = Py_None; Py_INCREF(Py_None);
  p->userattribs = Py_None; Py_INCREF(Py_None);
  if (__pyx_f_3ode_5Joint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_Joint(PyObject *o) {
  struct __pyx_obj_3ode_Joint *p = (struct __pyx_obj_3ode_Joint *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_3ode_5Joint___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(p->world);
  Py_XDECREF(p->body1);
  Py_XDECREF(p->body2);
  Py_XDECREF(p->userattribs);
  (*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_3ode_Joint(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_Joint *p = (struct __pyx_obj_3ode_Joint *)o;
  if (p->world) {
    e = (*v)(p->world, a); if (e) return e;
  }
  if (p->body1) {
    e = (*v)(p->body1, a); if (e) return e;
  }
  if (p->body2) {
    e = (*v)(p->body2, a); if (e) return e;
  }
  if (p->userattribs) {
    e = (*v)(p->userattribs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3ode_Joint(PyObject *o) {
  struct __pyx_obj_3ode_Joint *p = (struct __pyx_obj_3ode_Joint *)o;
  Py_XDECREF(p->world);
  p->world = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(p->body1);
  p->body1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(p->body2);
  p->body2 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(p->userattribs);
  p->userattribs = Py_None; Py_INCREF(Py_None);
  return 0;
}

static PyObject *__pyx_tp_getattro_3ode_Joint(PyObject *o, PyObject *n) {
  PyObject *v = PyObject_GenericGetAttr(o, n);
  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
    PyErr_Clear();
    v = __pyx_f_3ode_5Joint___getattr__(o, n);
  }
  return v;
}

static int __pyx_tp_setattro_3ode_Joint(PyObject *o, PyObject *n, PyObject *v) {
  if (v) {
    return __pyx_f_3ode_5Joint___setattr__(o, n, v);
  }
  else {
    return __pyx_f_3ode_5Joint___delattr__(o, n);
  }
}

static struct PyMethodDef __pyx_methods_3ode_Joint[] = {
  {"_destroyed", (PyCFunction)__pyx_f_3ode_5Joint__destroyed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5Joint__destroyed},
  {"attach", (PyCFunction)__pyx_f_3ode_5Joint_attach, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5Joint_attach},
  {"getBody", (PyCFunction)__pyx_f_3ode_5Joint_getBody, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5Joint_getBody},
  {"setFeedback", (PyCFunction)__pyx_f_3ode_5Joint_setFeedback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5Joint_setFeedback},
  {"getFeedback", (PyCFunction)__pyx_f_3ode_5Joint_getFeedback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_5Joint_getFeedback},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Joint = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_Joint = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Joint = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Joint = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_Joint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.Joint", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_Joint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_Joint, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_Joint, /*tp_as_number*/
  &__pyx_tp_as_sequence_Joint, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Joint, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  __pyx_tp_getattro_3ode_Joint, /*tp_getattro*/
  __pyx_tp_setattro_3ode_Joint, /*tp_setattro*/
  &__pyx_tp_as_buffer_Joint, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Base class for all joint classes.", /*tp_doc*/
  __pyx_tp_traverse_3ode_Joint, /*tp_traverse*/
  __pyx_tp_clear_3ode_Joint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_Joint, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_5Joint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_Joint, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_BallJoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_Joint->tp_new(t, a, k);
  if (__pyx_f_3ode_9BallJoint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_BallJoint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_BallJoint(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_Joint->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_BallJoint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_BallJoint[] = {
  {"setAnchor", (PyCFunction)__pyx_f_3ode_9BallJoint_setAnchor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_9BallJoint_setAnchor},
  {"getAnchor", (PyCFunction)__pyx_f_3ode_9BallJoint_getAnchor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_9BallJoint_getAnchor},
  {"getAnchor2", (PyCFunction)__pyx_f_3ode_9BallJoint_getAnchor2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_9BallJoint_getAnchor2},
  {"setParam", (PyCFunction)__pyx_f_3ode_9BallJoint_setParam, METH_VARARGS|METH_KEYWORDS, 0},
  {"getParam", (PyCFunction)__pyx_f_3ode_9BallJoint_getParam, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_BallJoint = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_BallJoint = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_BallJoint = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_BallJoint = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_BallJoint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.BallJoint", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_BallJoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_BallJoint, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_BallJoint, /*tp_as_number*/
  &__pyx_tp_as_sequence_BallJoint, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_BallJoint, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_BallJoint, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Ball joint.\n\n    Constructor::\n    \n      BallJoint(world, jointgroup=None)    \n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_BallJoint, /*tp_traverse*/
  __pyx_tp_clear_3ode_BallJoint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_BallJoint, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_9BallJoint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_BallJoint, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_HingeJoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_Joint->tp_new(t, a, k);
  if (__pyx_f_3ode_10HingeJoint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_HingeJoint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_HingeJoint(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_Joint->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_HingeJoint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_HingeJoint[] = {
  {"setAnchor", (PyCFunction)__pyx_f_3ode_10HingeJoint_setAnchor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10HingeJoint_setAnchor},
  {"getAnchor", (PyCFunction)__pyx_f_3ode_10HingeJoint_getAnchor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10HingeJoint_getAnchor},
  {"getAnchor2", (PyCFunction)__pyx_f_3ode_10HingeJoint_getAnchor2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10HingeJoint_getAnchor2},
  {"setAxis", (PyCFunction)__pyx_f_3ode_10HingeJoint_setAxis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10HingeJoint_setAxis},
  {"getAxis", (PyCFunction)__pyx_f_3ode_10HingeJoint_getAxis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10HingeJoint_getAxis},
  {"getAngle", (PyCFunction)__pyx_f_3ode_10HingeJoint_getAngle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10HingeJoint_getAngle},
  {"getAngleRate", (PyCFunction)__pyx_f_3ode_10HingeJoint_getAngleRate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10HingeJoint_getAngleRate},
  {"addTorque", (PyCFunction)__pyx_f_3ode_10HingeJoint_addTorque, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10HingeJoint_addTorque},
  {"setParam", (PyCFunction)__pyx_f_3ode_10HingeJoint_setParam, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10HingeJoint_setParam},
  {"getParam", (PyCFunction)__pyx_f_3ode_10HingeJoint_getParam, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10HingeJoint_getParam},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_HingeJoint = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_HingeJoint = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_HingeJoint = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_HingeJoint = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_HingeJoint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.HingeJoint", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_HingeJoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_HingeJoint, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_HingeJoint, /*tp_as_number*/
  &__pyx_tp_as_sequence_HingeJoint, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_HingeJoint, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_HingeJoint, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Hinge joint.\n\n    Constructor::\n    \n      HingeJoint(world, jointgroup=None)\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_HingeJoint, /*tp_traverse*/
  __pyx_tp_clear_3ode_HingeJoint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_HingeJoint, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_10HingeJoint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_HingeJoint, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_SliderJoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_Joint->tp_new(t, a, k);
  if (__pyx_f_3ode_11SliderJoint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_SliderJoint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_SliderJoint(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_Joint->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_SliderJoint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_SliderJoint[] = {
  {"setAxis", (PyCFunction)__pyx_f_3ode_11SliderJoint_setAxis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11SliderJoint_setAxis},
  {"getAxis", (PyCFunction)__pyx_f_3ode_11SliderJoint_getAxis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11SliderJoint_getAxis},
  {"getPosition", (PyCFunction)__pyx_f_3ode_11SliderJoint_getPosition, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11SliderJoint_getPosition},
  {"getPositionRate", (PyCFunction)__pyx_f_3ode_11SliderJoint_getPositionRate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11SliderJoint_getPositionRate},
  {"addForce", (PyCFunction)__pyx_f_3ode_11SliderJoint_addForce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11SliderJoint_addForce},
  {"setParam", (PyCFunction)__pyx_f_3ode_11SliderJoint_setParam, METH_VARARGS|METH_KEYWORDS, 0},
  {"getParam", (PyCFunction)__pyx_f_3ode_11SliderJoint_getParam, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_SliderJoint = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_SliderJoint = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_SliderJoint = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_SliderJoint = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_SliderJoint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.SliderJoint", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_SliderJoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_SliderJoint, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_SliderJoint, /*tp_as_number*/
  &__pyx_tp_as_sequence_SliderJoint, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_SliderJoint, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_SliderJoint, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Slider joint.\n    \n    Constructor::\n    \n      SlideJoint(world, jointgroup=None)\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_SliderJoint, /*tp_traverse*/
  __pyx_tp_clear_3ode_SliderJoint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_SliderJoint, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_11SliderJoint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_SliderJoint, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_UniversalJoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_Joint->tp_new(t, a, k);
  if (__pyx_f_3ode_14UniversalJoint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_UniversalJoint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_UniversalJoint(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_Joint->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_UniversalJoint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_UniversalJoint[] = {
  {"setAnchor", (PyCFunction)__pyx_f_3ode_14UniversalJoint_setAnchor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_14UniversalJoint_setAnchor},
  {"getAnchor", (PyCFunction)__pyx_f_3ode_14UniversalJoint_getAnchor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_14UniversalJoint_getAnchor},
  {"getAnchor2", (PyCFunction)__pyx_f_3ode_14UniversalJoint_getAnchor2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_14UniversalJoint_getAnchor2},
  {"setAxis1", (PyCFunction)__pyx_f_3ode_14UniversalJoint_setAxis1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_14UniversalJoint_setAxis1},
  {"getAxis1", (PyCFunction)__pyx_f_3ode_14UniversalJoint_getAxis1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_14UniversalJoint_getAxis1},
  {"setAxis2", (PyCFunction)__pyx_f_3ode_14UniversalJoint_setAxis2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_14UniversalJoint_setAxis2},
  {"getAxis2", (PyCFunction)__pyx_f_3ode_14UniversalJoint_getAxis2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_14UniversalJoint_getAxis2},
  {"addTorques", (PyCFunction)__pyx_f_3ode_14UniversalJoint_addTorques, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_14UniversalJoint_addTorques},
  {"setParam", (PyCFunction)__pyx_f_3ode_14UniversalJoint_setParam, METH_VARARGS|METH_KEYWORDS, 0},
  {"getParam", (PyCFunction)__pyx_f_3ode_14UniversalJoint_getParam, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_UniversalJoint = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_UniversalJoint = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_UniversalJoint = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_UniversalJoint = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_UniversalJoint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.UniversalJoint", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_UniversalJoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_UniversalJoint, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_UniversalJoint, /*tp_as_number*/
  &__pyx_tp_as_sequence_UniversalJoint, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_UniversalJoint, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_UniversalJoint, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Universal joint.\n\n    Constructor::\n    \n      UniversalJoint(world, jointgroup=None)    \n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_UniversalJoint, /*tp_traverse*/
  __pyx_tp_clear_3ode_UniversalJoint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_UniversalJoint, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_14UniversalJoint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_UniversalJoint, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_Hinge2Joint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_Joint->tp_new(t, a, k);
  if (__pyx_f_3ode_11Hinge2Joint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_Hinge2Joint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_Hinge2Joint(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_Joint->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_Hinge2Joint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_Hinge2Joint[] = {
  {"setAnchor", (PyCFunction)__pyx_f_3ode_11Hinge2Joint_setAnchor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11Hinge2Joint_setAnchor},
  {"getAnchor", (PyCFunction)__pyx_f_3ode_11Hinge2Joint_getAnchor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11Hinge2Joint_getAnchor},
  {"getAnchor2", (PyCFunction)__pyx_f_3ode_11Hinge2Joint_getAnchor2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11Hinge2Joint_getAnchor2},
  {"setAxis1", (PyCFunction)__pyx_f_3ode_11Hinge2Joint_setAxis1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11Hinge2Joint_setAxis1},
  {"getAxis1", (PyCFunction)__pyx_f_3ode_11Hinge2Joint_getAxis1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11Hinge2Joint_getAxis1},
  {"setAxis2", (PyCFunction)__pyx_f_3ode_11Hinge2Joint_setAxis2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11Hinge2Joint_setAxis2},
  {"getAxis2", (PyCFunction)__pyx_f_3ode_11Hinge2Joint_getAxis2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11Hinge2Joint_getAxis2},
  {"getAngle1", (PyCFunction)__pyx_f_3ode_11Hinge2Joint_getAngle1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11Hinge2Joint_getAngle1},
  {"getAngle1Rate", (PyCFunction)__pyx_f_3ode_11Hinge2Joint_getAngle1Rate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11Hinge2Joint_getAngle1Rate},
  {"getAngle2Rate", (PyCFunction)__pyx_f_3ode_11Hinge2Joint_getAngle2Rate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11Hinge2Joint_getAngle2Rate},
  {"addTorques", (PyCFunction)__pyx_f_3ode_11Hinge2Joint_addTorques, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11Hinge2Joint_addTorques},
  {"setParam", (PyCFunction)__pyx_f_3ode_11Hinge2Joint_setParam, METH_VARARGS|METH_KEYWORDS, 0},
  {"getParam", (PyCFunction)__pyx_f_3ode_11Hinge2Joint_getParam, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Hinge2Joint = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_Hinge2Joint = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Hinge2Joint = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Hinge2Joint = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_Hinge2Joint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.Hinge2Joint", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_Hinge2Joint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_Hinge2Joint, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_Hinge2Joint, /*tp_as_number*/
  &__pyx_tp_as_sequence_Hinge2Joint, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Hinge2Joint, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Hinge2Joint, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Hinge2 joint.\n\n    Constructor::\n    \n      Hinge2Joint(world, jointgroup=None)\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_Hinge2Joint, /*tp_traverse*/
  __pyx_tp_clear_3ode_Hinge2Joint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_Hinge2Joint, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_11Hinge2Joint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_Hinge2Joint, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_FixedJoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_Joint->tp_new(t, a, k);
  if (__pyx_f_3ode_10FixedJoint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_FixedJoint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_FixedJoint(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_Joint->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_FixedJoint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_FixedJoint[] = {
  {"setFixed", (PyCFunction)__pyx_f_3ode_10FixedJoint_setFixed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10FixedJoint_setFixed},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FixedJoint = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_FixedJoint = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_FixedJoint = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FixedJoint = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_FixedJoint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.FixedJoint", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_FixedJoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_FixedJoint, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_FixedJoint, /*tp_as_number*/
  &__pyx_tp_as_sequence_FixedJoint, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FixedJoint, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FixedJoint, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Fixed joint.\n\n    Constructor::\n    \n      FixedJoint(world, jointgroup=None)    \n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_FixedJoint, /*tp_traverse*/
  __pyx_tp_clear_3ode_FixedJoint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_FixedJoint, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_10FixedJoint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_FixedJoint, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_ContactJoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_Joint->tp_new(t, a, k);
  if (__pyx_f_3ode_12ContactJoint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_ContactJoint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_ContactJoint(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_Joint->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_ContactJoint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_ContactJoint[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ContactJoint = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_ContactJoint = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ContactJoint = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ContactJoint = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_ContactJoint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.ContactJoint", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_ContactJoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_ContactJoint, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_ContactJoint, /*tp_as_number*/
  &__pyx_tp_as_sequence_ContactJoint, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ContactJoint, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_ContactJoint, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Contact joint.\n\n    Constructor::\n    \n      ContactJoint(world, jointgroup, contact)\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_ContactJoint, /*tp_traverse*/
  __pyx_tp_clear_3ode_ContactJoint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_ContactJoint, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_12ContactJoint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_ContactJoint, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_AMotor(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_Joint->tp_new(t, a, k);
  if (__pyx_f_3ode_6AMotor___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_AMotor(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_AMotor(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_Joint->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_AMotor(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_AMotor[] = {
  {"setMode", (PyCFunction)__pyx_f_3ode_6AMotor_setMode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6AMotor_setMode},
  {"getMode", (PyCFunction)__pyx_f_3ode_6AMotor_getMode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6AMotor_getMode},
  {"setNumAxes", (PyCFunction)__pyx_f_3ode_6AMotor_setNumAxes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6AMotor_setNumAxes},
  {"getNumAxes", (PyCFunction)__pyx_f_3ode_6AMotor_getNumAxes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6AMotor_getNumAxes},
  {"setAxis", (PyCFunction)__pyx_f_3ode_6AMotor_setAxis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6AMotor_setAxis},
  {"getAxis", (PyCFunction)__pyx_f_3ode_6AMotor_getAxis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6AMotor_getAxis},
  {"getAxisRel", (PyCFunction)__pyx_f_3ode_6AMotor_getAxisRel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6AMotor_getAxisRel},
  {"setAngle", (PyCFunction)__pyx_f_3ode_6AMotor_setAngle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6AMotor_setAngle},
  {"getAngle", (PyCFunction)__pyx_f_3ode_6AMotor_getAngle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6AMotor_getAngle},
  {"getAngleRate", (PyCFunction)__pyx_f_3ode_6AMotor_getAngleRate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6AMotor_getAngleRate},
  {"addTorques", (PyCFunction)__pyx_f_3ode_6AMotor_addTorques, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6AMotor_addTorques},
  {"setParam", (PyCFunction)__pyx_f_3ode_6AMotor_setParam, METH_VARARGS|METH_KEYWORDS, 0},
  {"getParam", (PyCFunction)__pyx_f_3ode_6AMotor_getParam, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_AMotor = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_AMotor = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_AMotor = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_AMotor = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_AMotor = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.AMotor", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_AMotor), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_AMotor, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_AMotor, /*tp_as_number*/
  &__pyx_tp_as_sequence_AMotor, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_AMotor, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_AMotor, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "AMotor joint.\n    \n    Constructor::\n    \n      AMotor(world, jointgroup=None)\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_AMotor, /*tp_traverse*/
  __pyx_tp_clear_3ode_AMotor, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_AMotor, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_6AMotor___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_AMotor, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_LMotor(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_Joint->tp_new(t, a, k);
  if (__pyx_f_3ode_6LMotor___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_LMotor(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_LMotor(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_Joint->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_LMotor(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_LMotor[] = {
  {"setNumAxes", (PyCFunction)__pyx_f_3ode_6LMotor_setNumAxes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6LMotor_setNumAxes},
  {"getNumAxes", (PyCFunction)__pyx_f_3ode_6LMotor_getNumAxes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6LMotor_getNumAxes},
  {"setAxis", (PyCFunction)__pyx_f_3ode_6LMotor_setAxis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6LMotor_setAxis},
  {"getAxis", (PyCFunction)__pyx_f_3ode_6LMotor_getAxis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_6LMotor_getAxis},
  {"setParam", (PyCFunction)__pyx_f_3ode_6LMotor_setParam, METH_VARARGS|METH_KEYWORDS, 0},
  {"getParam", (PyCFunction)__pyx_f_3ode_6LMotor_getParam, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_LMotor = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_LMotor = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_LMotor = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_LMotor = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_LMotor = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.LMotor", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_LMotor), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_LMotor, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_LMotor, /*tp_as_number*/
  &__pyx_tp_as_sequence_LMotor, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_LMotor, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_LMotor, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "LMotor joint.\n    \n    Constructor::\n    \n      LMotor(world, jointgroup=None)\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_LMotor, /*tp_traverse*/
  __pyx_tp_clear_3ode_LMotor, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_LMotor, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_6LMotor___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_LMotor, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_Plane2DJoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_Joint->tp_new(t, a, k);
  if (__pyx_f_3ode_12Plane2DJoint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_Plane2DJoint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_Plane2DJoint(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_Joint->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_Plane2DJoint(PyObject *o) {
  __pyx_ptype_3ode_Joint->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_Plane2DJoint[] = {
  {"setXParam", (PyCFunction)__pyx_f_3ode_12Plane2DJoint_setXParam, METH_VARARGS|METH_KEYWORDS, 0},
  {"setYParam", (PyCFunction)__pyx_f_3ode_12Plane2DJoint_setYParam, METH_VARARGS|METH_KEYWORDS, 0},
  {"setAngleParam", (PyCFunction)__pyx_f_3ode_12Plane2DJoint_setAngleParam, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Plane2DJoint = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_Plane2DJoint = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Plane2DJoint = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Plane2DJoint = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_Plane2DJoint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.Plane2DJoint", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_Plane2DJoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_Plane2DJoint, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_Plane2DJoint, /*tp_as_number*/
  &__pyx_tp_as_sequence_Plane2DJoint, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Plane2DJoint, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Plane2DJoint, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Plane-2D Joint.\n\n    Constructor::\n    \n      Plane2DJoint(world, jointgroup=None)    \n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_Plane2DJoint, /*tp_traverse*/
  __pyx_tp_clear_3ode_Plane2DJoint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_Plane2DJoint, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_12Plane2DJoint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_Plane2DJoint, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_GeomObject(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  struct __pyx_obj_3ode_GeomObject *p = (struct __pyx_obj_3ode_GeomObject *)o;
  p->space = Py_None; Py_INCREF(Py_None);
  p->body = Py_None; Py_INCREF(Py_None);
  p->attribs = Py_None; Py_INCREF(Py_None);
  if (__pyx_f_3ode_10GeomObject___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_GeomObject(PyObject *o) {
  struct __pyx_obj_3ode_GeomObject *p = (struct __pyx_obj_3ode_GeomObject *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_3ode_10GeomObject___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(p->space);
  Py_XDECREF(p->body);
  Py_XDECREF(p->attribs);
  (*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_3ode_GeomObject(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_GeomObject *p = (struct __pyx_obj_3ode_GeomObject *)o;
  if (p->space) {
    e = (*v)(p->space, a); if (e) return e;
  }
  if (p->body) {
    e = (*v)(p->body, a); if (e) return e;
  }
  if (p->attribs) {
    e = (*v)(p->attribs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3ode_GeomObject(PyObject *o) {
  struct __pyx_obj_3ode_GeomObject *p = (struct __pyx_obj_3ode_GeomObject *)o;
  Py_XDECREF(p->space);
  p->space = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(p->body);
  p->body = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(p->attribs);
  p->attribs = Py_None; Py_INCREF(Py_None);
  return 0;
}

static PyObject *__pyx_tp_getattro_3ode_GeomObject(PyObject *o, PyObject *n) {
  PyObject *v = PyObject_GenericGetAttr(o, n);
  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
    PyErr_Clear();
    v = __pyx_f_3ode_10GeomObject___getattr__(o, n);
  }
  return v;
}

static int __pyx_tp_setattro_3ode_GeomObject(PyObject *o, PyObject *n, PyObject *v) {
  if (v) {
    return __pyx_f_3ode_10GeomObject___setattr__(o, n, v);
  }
  else {
    return PyObject_GenericSetAttr(o, n, 0);
  }
}

static struct PyMethodDef __pyx_methods_3ode_GeomObject[] = {
  {"_id", (PyCFunction)__pyx_f_3ode_10GeomObject__id, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject__id},
  {"placeable", (PyCFunction)__pyx_f_3ode_10GeomObject_placeable, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_placeable},
  {"setBody", (PyCFunction)__pyx_f_3ode_10GeomObject_setBody, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_setBody},
  {"getBody", (PyCFunction)__pyx_f_3ode_10GeomObject_getBody, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_getBody},
  {"setPosition", (PyCFunction)__pyx_f_3ode_10GeomObject_setPosition, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_setPosition},
  {"getPosition", (PyCFunction)__pyx_f_3ode_10GeomObject_getPosition, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_getPosition},
  {"setRotation", (PyCFunction)__pyx_f_3ode_10GeomObject_setRotation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_setRotation},
  {"getRotation", (PyCFunction)__pyx_f_3ode_10GeomObject_getRotation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_getRotation},
  {"getQuaternion", (PyCFunction)__pyx_f_3ode_10GeomObject_getQuaternion, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_getQuaternion},
  {"setQuaternion", (PyCFunction)__pyx_f_3ode_10GeomObject_setQuaternion, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_setQuaternion},
  {"getAABB", (PyCFunction)__pyx_f_3ode_10GeomObject_getAABB, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_getAABB},
  {"isSpace", (PyCFunction)__pyx_f_3ode_10GeomObject_isSpace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_isSpace},
  {"getSpace", (PyCFunction)__pyx_f_3ode_10GeomObject_getSpace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_getSpace},
  {"setCollideBits", (PyCFunction)__pyx_f_3ode_10GeomObject_setCollideBits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_setCollideBits},
  {"setCategoryBits", (PyCFunction)__pyx_f_3ode_10GeomObject_setCategoryBits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_setCategoryBits},
  {"getCollideBits", (PyCFunction)__pyx_f_3ode_10GeomObject_getCollideBits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_getCollideBits},
  {"getCategoryBits", (PyCFunction)__pyx_f_3ode_10GeomObject_getCategoryBits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_getCategoryBits},
  {"enable", (PyCFunction)__pyx_f_3ode_10GeomObject_enable, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_enable},
  {"disable", (PyCFunction)__pyx_f_3ode_10GeomObject_disable, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_disable},
  {"isEnabled", (PyCFunction)__pyx_f_3ode_10GeomObject_isEnabled, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomObject_isEnabled},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_GeomObject = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_GeomObject = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_GeomObject = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_GeomObject = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_GeomObject = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.GeomObject", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_GeomObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_GeomObject, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_GeomObject, /*tp_as_number*/
  &__pyx_tp_as_sequence_GeomObject, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_GeomObject, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  __pyx_tp_getattro_3ode_GeomObject, /*tp_getattro*/
  __pyx_tp_setattro_3ode_GeomObject, /*tp_setattro*/
  &__pyx_tp_as_buffer_GeomObject, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "This is the abstract base class for all geom objects.\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_GeomObject, /*tp_traverse*/
  __pyx_tp_clear_3ode_GeomObject, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_GeomObject, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_10GeomObject___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_GeomObject, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_SpaceBase(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_GeomObject->tp_new(t, a, k);
  if (__pyx_f_3ode_9SpaceBase___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_SpaceBase(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_3ode_9SpaceBase___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_ptype_3ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_SpaceBase(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_SpaceBase(PyObject *o) {
  __pyx_ptype_3ode_GeomObject->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_SpaceBase[] = {
  {"_id", (PyCFunction)__pyx_f_3ode_9SpaceBase__id, METH_VARARGS|METH_KEYWORDS, 0},
  {"add", (PyCFunction)__pyx_f_3ode_9SpaceBase_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_9SpaceBase_add},
  {"remove", (PyCFunction)__pyx_f_3ode_9SpaceBase_remove, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_9SpaceBase_remove},
  {"query", (PyCFunction)__pyx_f_3ode_9SpaceBase_query, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_9SpaceBase_query},
  {"getNumGeoms", (PyCFunction)__pyx_f_3ode_9SpaceBase_getNumGeoms, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_9SpaceBase_getNumGeoms},
  {"getGeom", (PyCFunction)__pyx_f_3ode_9SpaceBase_getGeom, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_9SpaceBase_getGeom},
  {"collide", (PyCFunction)__pyx_f_3ode_9SpaceBase_collide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_9SpaceBase_collide},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_SpaceBase = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_SpaceBase = {
  __pyx_f_3ode_9SpaceBase___len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_SpaceBase = {
  __pyx_f_3ode_9SpaceBase___len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_SpaceBase = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_SpaceBase = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.SpaceBase", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_SpaceBase), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_SpaceBase, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_SpaceBase, /*tp_as_number*/
  &__pyx_tp_as_sequence_SpaceBase, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_SpaceBase, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_SpaceBase, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Space class (container for geometry objects).\n\n    A Space object is a container for geometry objects which are used\n    to do collision detection.\n    The space does high level collision culling, which means that it\n    can identify which pairs of geometry objects are potentially\n    touching.\n\n    This Space class can be used for both, a SimpleSpace and a HashSpace\n    (see ODE documentation).\n\n     >>> space = Space(type=0)   # Create a SimpleSpace\n     >>> space = Space(type=1)   # Create a HashSpace\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_SpaceBase, /*tp_traverse*/
  __pyx_tp_clear_3ode_SpaceBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_f_3ode_9SpaceBase___iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_SpaceBase, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_9SpaceBase___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_SpaceBase, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_SimpleSpace(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_SpaceBase->tp_new(t, a, k);
  if (__pyx_f_3ode_11SimpleSpace___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_SimpleSpace(PyObject *o) {
  __pyx_ptype_3ode_SpaceBase->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_SimpleSpace(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_SpaceBase->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_SimpleSpace(PyObject *o) {
  __pyx_ptype_3ode_SpaceBase->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_SimpleSpace[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_SimpleSpace = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_SimpleSpace = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_SimpleSpace = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_SimpleSpace = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_SimpleSpace = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.SimpleSpace", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_SimpleSpace), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_SimpleSpace, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_SimpleSpace, /*tp_as_number*/
  &__pyx_tp_as_sequence_SimpleSpace, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_SimpleSpace, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_SimpleSpace, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Simple space.\n\n    This does not do any collision culling - it simply checks every\n    possible pair of geoms for intersection, and reports the pairs\n    whose AABBs overlap. The time required to do intersection testing\n    for n objects is O(n**2). This should not be used for large numbers\n    of objects, but it can be the preferred algorithm for a small\n    number of objects. This is also useful for debugging potential\n    problems with the collision system.\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_SimpleSpace, /*tp_traverse*/
  __pyx_tp_clear_3ode_SimpleSpace, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_SimpleSpace, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_11SimpleSpace___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_SimpleSpace, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_HashSpace(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_SpaceBase->tp_new(t, a, k);
  if (__pyx_f_3ode_9HashSpace___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_HashSpace(PyObject *o) {
  __pyx_ptype_3ode_SpaceBase->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_HashSpace(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_SpaceBase->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_HashSpace(PyObject *o) {
  __pyx_ptype_3ode_SpaceBase->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_HashSpace[] = {
  {"setLevels", (PyCFunction)__pyx_f_3ode_9HashSpace_setLevels, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_9HashSpace_setLevels},
  {"getLevels", (PyCFunction)__pyx_f_3ode_9HashSpace_getLevels, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_9HashSpace_getLevels},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_HashSpace = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_HashSpace = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_HashSpace = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_HashSpace = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_HashSpace = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.HashSpace", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_HashSpace), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_HashSpace, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_HashSpace, /*tp_as_number*/
  &__pyx_tp_as_sequence_HashSpace, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_HashSpace, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_HashSpace, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Multi-resolution hash table space.\n\n    This uses an internal data structure that records how each geom\n    overlaps cells in one of several three dimensional grids. Each\n    grid has cubical cells of side lengths 2**i, where i is an integer\n    that ranges from a minimum to a maximum value. The time required\n    to do intersection testing for n objects is O(n) (as long as those\n    objects are not clustered together too closely), as each object\n    can be quickly paired with the objects around it.\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_HashSpace, /*tp_traverse*/
  __pyx_tp_clear_3ode_HashSpace, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_HashSpace, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_9HashSpace___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_HashSpace, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_QuadTreeSpace(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_SpaceBase->tp_new(t, a, k);
  if (__pyx_f_3ode_13QuadTreeSpace___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_QuadTreeSpace(PyObject *o) {
  __pyx_ptype_3ode_SpaceBase->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_QuadTreeSpace(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_SpaceBase->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_QuadTreeSpace(PyObject *o) {
  __pyx_ptype_3ode_SpaceBase->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_QuadTreeSpace[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_QuadTreeSpace = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_QuadTreeSpace = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_QuadTreeSpace = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_QuadTreeSpace = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_QuadTreeSpace = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.QuadTreeSpace", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_QuadTreeSpace), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_QuadTreeSpace, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_QuadTreeSpace, /*tp_as_number*/
  &__pyx_tp_as_sequence_QuadTreeSpace, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_QuadTreeSpace, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_QuadTreeSpace, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Quadtree space.\n\n    This uses a pre-allocated hierarchical grid-based AABB tree to\n    quickly cull collision checks. It\'s exceptionally quick for large\n    amounts of objects in landscape-shaped worlds. The amount of\n    memory used is 4**depth * 32 bytes.\n\n    Currently getGeom() is not implemented for the quadtree space.\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_QuadTreeSpace, /*tp_traverse*/
  __pyx_tp_clear_3ode_QuadTreeSpace, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_QuadTreeSpace, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_13QuadTreeSpace___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_QuadTreeSpace, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_GeomSphere(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_GeomObject->tp_new(t, a, k);
  if (__pyx_f_3ode_10GeomSphere___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_GeomSphere(PyObject *o) {
  __pyx_ptype_3ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_GeomSphere(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_GeomSphere(PyObject *o) {
  __pyx_ptype_3ode_GeomObject->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_GeomSphere[] = {
  {"placeable", (PyCFunction)__pyx_f_3ode_10GeomSphere_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {"_id", (PyCFunction)__pyx_f_3ode_10GeomSphere__id, METH_VARARGS|METH_KEYWORDS, 0},
  {"setRadius", (PyCFunction)__pyx_f_3ode_10GeomSphere_setRadius, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomSphere_setRadius},
  {"getRadius", (PyCFunction)__pyx_f_3ode_10GeomSphere_getRadius, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomSphere_getRadius},
  {"pointDepth", (PyCFunction)__pyx_f_3ode_10GeomSphere_pointDepth, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_10GeomSphere_pointDepth},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_GeomSphere = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_GeomSphere = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_GeomSphere = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_GeomSphere = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_GeomSphere = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.GeomSphere", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_GeomSphere), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_GeomSphere, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_GeomSphere, /*tp_as_number*/
  &__pyx_tp_as_sequence_GeomSphere, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_GeomSphere, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_GeomSphere, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Sphere geometry.\n\n    This class represents a sphere centered at the origin.\n\n    Constructor::\n    \n      GeomSphere(space=None, radius=1.0)\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_GeomSphere, /*tp_traverse*/
  __pyx_tp_clear_3ode_GeomSphere, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_GeomSphere, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_10GeomSphere___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_GeomSphere, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_GeomBox(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_GeomObject->tp_new(t, a, k);
  if (__pyx_f_3ode_7GeomBox___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_GeomBox(PyObject *o) {
  __pyx_ptype_3ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_GeomBox(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_GeomBox(PyObject *o) {
  __pyx_ptype_3ode_GeomObject->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_GeomBox[] = {
  {"placeable", (PyCFunction)__pyx_f_3ode_7GeomBox_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {"_id", (PyCFunction)__pyx_f_3ode_7GeomBox__id, METH_VARARGS|METH_KEYWORDS, 0},
  {"setLengths", (PyCFunction)__pyx_f_3ode_7GeomBox_setLengths, METH_VARARGS|METH_KEYWORDS, 0},
  {"getLengths", (PyCFunction)__pyx_f_3ode_7GeomBox_getLengths, METH_VARARGS|METH_KEYWORDS, 0},
  {"pointDepth", (PyCFunction)__pyx_f_3ode_7GeomBox_pointDepth, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_7GeomBox_pointDepth},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_GeomBox = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_GeomBox = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_GeomBox = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_GeomBox = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_GeomBox = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.GeomBox", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_GeomBox), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_GeomBox, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_GeomBox, /*tp_as_number*/
  &__pyx_tp_as_sequence_GeomBox, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_GeomBox, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_GeomBox, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Box geometry.\n\n    This class represents a box centered at the origin.\n\n    Constructor::\n    \n      GeomBox(space=None, lengths=(1.0, 1.0, 1.0))\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_GeomBox, /*tp_traverse*/
  __pyx_tp_clear_3ode_GeomBox, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_GeomBox, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_7GeomBox___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_GeomBox, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_GeomPlane(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_GeomObject->tp_new(t, a, k);
  if (__pyx_f_3ode_9GeomPlane___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_GeomPlane(PyObject *o) {
  __pyx_ptype_3ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_GeomPlane(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_GeomPlane(PyObject *o) {
  __pyx_ptype_3ode_GeomObject->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_GeomPlane[] = {
  {"_id", (PyCFunction)__pyx_f_3ode_9GeomPlane__id, METH_VARARGS|METH_KEYWORDS, 0},
  {"setParams", (PyCFunction)__pyx_f_3ode_9GeomPlane_setParams, METH_VARARGS|METH_KEYWORDS, 0},
  {"getParams", (PyCFunction)__pyx_f_3ode_9GeomPlane_getParams, METH_VARARGS|METH_KEYWORDS, 0},
  {"pointDepth", (PyCFunction)__pyx_f_3ode_9GeomPlane_pointDepth, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_9GeomPlane_pointDepth},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_GeomPlane = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_GeomPlane = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_GeomPlane = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_GeomPlane = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_GeomPlane = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.GeomPlane", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_GeomPlane), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_GeomPlane, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_GeomPlane, /*tp_as_number*/
  &__pyx_tp_as_sequence_GeomPlane, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_GeomPlane, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_GeomPlane, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Plane geometry.\n\n    This class represents an infinite plane. The plane equation is:\n    n.x*x + n.y*y + n.z*z = dist\n\n    This object can\'t be attached to a body.\n    If you call getBody() on this object it always returns ode.environment.\n\n    Constructor::\n    \n      GeomPlane(space=None, normal=(0,0,1), dist=0)\n\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_GeomPlane, /*tp_traverse*/
  __pyx_tp_clear_3ode_GeomPlane, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_GeomPlane, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_9GeomPlane___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_GeomPlane, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_GeomCapsule(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_GeomObject->tp_new(t, a, k);
  if (__pyx_f_3ode_11GeomCapsule___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_GeomCapsule(PyObject *o) {
  __pyx_ptype_3ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_GeomCapsule(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_GeomCapsule(PyObject *o) {
  __pyx_ptype_3ode_GeomObject->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_GeomCapsule[] = {
  {"placeable", (PyCFunction)__pyx_f_3ode_11GeomCapsule_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {"_id", (PyCFunction)__pyx_f_3ode_11GeomCapsule__id, METH_VARARGS|METH_KEYWORDS, 0},
  {"setParams", (PyCFunction)__pyx_f_3ode_11GeomCapsule_setParams, METH_VARARGS|METH_KEYWORDS, 0},
  {"getParams", (PyCFunction)__pyx_f_3ode_11GeomCapsule_getParams, METH_VARARGS|METH_KEYWORDS, 0},
  {"pointDepth", (PyCFunction)__pyx_f_3ode_11GeomCapsule_pointDepth, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11GeomCapsule_pointDepth},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_GeomCapsule = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_GeomCapsule = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_GeomCapsule = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_GeomCapsule = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_GeomCapsule = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.GeomCapsule", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_GeomCapsule), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_GeomCapsule, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_GeomCapsule, /*tp_as_number*/
  &__pyx_tp_as_sequence_GeomCapsule, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_GeomCapsule, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_GeomCapsule, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Capped cylinder geometry.\n\n    This class represents a capped cylinder aligned along the local Z axis\n    and centered at the origin.\n\n    Constructor::\n    \n      GeomCapsule(space=None, radius=0.5, length=1.0)\n\n    The length parameter does not include the caps.\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_GeomCapsule, /*tp_traverse*/
  __pyx_tp_clear_3ode_GeomCapsule, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_GeomCapsule, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_11GeomCapsule___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_GeomCapsule, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_GeomCylinder(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_GeomObject->tp_new(t, a, k);
  if (__pyx_f_3ode_12GeomCylinder___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_GeomCylinder(PyObject *o) {
  __pyx_ptype_3ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_GeomCylinder(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_GeomCylinder(PyObject *o) {
  __pyx_ptype_3ode_GeomObject->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_GeomCylinder[] = {
  {"placeable", (PyCFunction)__pyx_f_3ode_12GeomCylinder_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {"_id", (PyCFunction)__pyx_f_3ode_12GeomCylinder__id, METH_VARARGS|METH_KEYWORDS, 0},
  {"setParams", (PyCFunction)__pyx_f_3ode_12GeomCylinder_setParams, METH_VARARGS|METH_KEYWORDS, 0},
  {"getParams", (PyCFunction)__pyx_f_3ode_12GeomCylinder_getParams, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_GeomCylinder = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_GeomCylinder = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_GeomCylinder = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_GeomCylinder = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_GeomCylinder = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.GeomCylinder", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_GeomCylinder), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_GeomCylinder, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_GeomCylinder, /*tp_as_number*/
  &__pyx_tp_as_sequence_GeomCylinder, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_GeomCylinder, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_GeomCylinder, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Plain cylinder geometry.\n\n    This class represents an uncapped cylinder aligned along the local Z axis\n    and centered at the origin.\n\n    Constructor::\n    \n      GeomCylinder(space=None, radius=0.5, length=1.0)\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_GeomCylinder, /*tp_traverse*/
  __pyx_tp_clear_3ode_GeomCylinder, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_GeomCylinder, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_12GeomCylinder___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_GeomCylinder, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_GeomRay(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_GeomObject->tp_new(t, a, k);
  if (__pyx_f_3ode_7GeomRay___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_GeomRay(PyObject *o) {
  __pyx_ptype_3ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_GeomRay(PyObject *o, visitproc v, void *a) {
  int e;
  e = __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a); if (e) return e;
  return 0;
}

static int __pyx_tp_clear_3ode_GeomRay(PyObject *o) {
  __pyx_ptype_3ode_GeomObject->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_GeomRay[] = {
  {"_id", (PyCFunction)__pyx_f_3ode_7GeomRay__id, METH_VARARGS|METH_KEYWORDS, 0},
  {"setLength", (PyCFunction)__pyx_f_3ode_7GeomRay_setLength, METH_VARARGS|METH_KEYWORDS, 0},
  {"getLength", (PyCFunction)__pyx_f_3ode_7GeomRay_getLength, METH_VARARGS|METH_KEYWORDS, 0},
  {"set", (PyCFunction)__pyx_f_3ode_7GeomRay_set, METH_VARARGS|METH_KEYWORDS, 0},
  {"get", (PyCFunction)__pyx_f_3ode_7GeomRay_get, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_GeomRay = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_GeomRay = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_GeomRay = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_GeomRay = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_GeomRay = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.GeomRay", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_GeomRay), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_GeomRay, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_GeomRay, /*tp_as_number*/
  &__pyx_tp_as_sequence_GeomRay, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_GeomRay, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_GeomRay, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Ray object.\n\n    A ray is different from all the other geom classes in that it does\n    not represent a solid object. It is an infinitely thin line that\n    starts from the geom\'s position and extends in the direction of\n    the geom\'s local Z-axis.\n\n    Constructor::\n    \n      GeomRay(space=None, rlen=1.0)\n    \n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_GeomRay, /*tp_traverse*/
  __pyx_tp_clear_3ode_GeomRay, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_GeomRay, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_7GeomRay___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_GeomRay, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_GeomTransform(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_GeomObject->tp_new(t, a, k);
  struct __pyx_obj_3ode_GeomTransform *p = (struct __pyx_obj_3ode_GeomTransform *)o;
  p->geom = Py_None; Py_INCREF(Py_None);
  if (__pyx_f_3ode_13GeomTransform___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_GeomTransform(PyObject *o) {
  struct __pyx_obj_3ode_GeomTransform *p = (struct __pyx_obj_3ode_GeomTransform *)o;
  Py_XDECREF(p->geom);
  __pyx_ptype_3ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_GeomTransform(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_GeomTransform *p = (struct __pyx_obj_3ode_GeomTransform *)o;
  e = __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a); if (e) return e;
  if (p->geom) {
    e = (*v)(p->geom, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3ode_GeomTransform(PyObject *o) {
  struct __pyx_obj_3ode_GeomTransform *p = (struct __pyx_obj_3ode_GeomTransform *)o;
  __pyx_ptype_3ode_GeomObject->tp_clear(o);
  Py_XDECREF(p->geom);
  p->geom = Py_None; Py_INCREF(Py_None);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_GeomTransform[] = {
  {"placeable", (PyCFunction)__pyx_f_3ode_13GeomTransform_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {"_id", (PyCFunction)__pyx_f_3ode_13GeomTransform__id, METH_VARARGS|METH_KEYWORDS, 0},
  {"setGeom", (PyCFunction)__pyx_f_3ode_13GeomTransform_setGeom, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_13GeomTransform_setGeom},
  {"getGeom", (PyCFunction)__pyx_f_3ode_13GeomTransform_getGeom, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_13GeomTransform_getGeom},
  {"setInfo", (PyCFunction)__pyx_f_3ode_13GeomTransform_setInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_13GeomTransform_setInfo},
  {"getInfo", (PyCFunction)__pyx_f_3ode_13GeomTransform_getInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_13GeomTransform_getInfo},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_GeomTransform = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_GeomTransform = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_GeomTransform = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_GeomTransform = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_GeomTransform = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.GeomTransform", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_GeomTransform), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_GeomTransform, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_GeomTransform, /*tp_as_number*/
  &__pyx_tp_as_sequence_GeomTransform, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_GeomTransform, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_GeomTransform, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "GeomTransform.\n\n    A geometry transform \"T\" is a geom that encapsulates another geom\n    \"E\", allowing E to be positioned and rotated arbitrarily with\n    respect to its point of reference.\n\n    Constructor::\n    \n      GeomTransform(space=None)    \n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_GeomTransform, /*tp_traverse*/
  __pyx_tp_clear_3ode_GeomTransform, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_GeomTransform, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_13GeomTransform___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_GeomTransform, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_TriMeshData(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (__pyx_f_3ode_11TriMeshData___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_TriMeshData(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_3ode_11TriMeshData___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  (*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_3ode_TriMeshData(PyObject *o, visitproc v, void *a) {
  return 0;
}

static int __pyx_tp_clear_3ode_TriMeshData(PyObject *o) {
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_TriMeshData[] = {
  {"build", (PyCFunction)__pyx_f_3ode_11TriMeshData_build, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11TriMeshData_build},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_TriMeshData = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_TriMeshData = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_TriMeshData = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_TriMeshData = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_TriMeshData = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.TriMeshData", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_TriMeshData), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_TriMeshData, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_TriMeshData, /*tp_as_number*/
  &__pyx_tp_as_sequence_TriMeshData, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_TriMeshData, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_TriMeshData, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "This class stores the mesh data.\n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_TriMeshData, /*tp_traverse*/
  __pyx_tp_clear_3ode_TriMeshData, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_TriMeshData, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_TriMeshData, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_3ode_GeomTriMesh(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_GeomObject->tp_new(t, a, k);
  struct __pyx_obj_3ode_GeomTriMesh *p = (struct __pyx_obj_3ode_GeomTriMesh *)o;
  p->data = ((struct __pyx_obj_3ode_TriMeshData *)Py_None); Py_INCREF(Py_None);
  if (__pyx_f_3ode_11GeomTriMesh___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_GeomTriMesh(PyObject *o) {
  struct __pyx_obj_3ode_GeomTriMesh *p = (struct __pyx_obj_3ode_GeomTriMesh *)o;
  Py_XDECREF(((PyObject *)p->data));
  __pyx_ptype_3ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_GeomTriMesh(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_GeomTriMesh *p = (struct __pyx_obj_3ode_GeomTriMesh *)o;
  e = __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a); if (e) return e;
  if (p->data) {
    e = (*v)(((PyObject*)p->data), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3ode_GeomTriMesh(PyObject *o) {
  struct __pyx_obj_3ode_GeomTriMesh *p = (struct __pyx_obj_3ode_GeomTriMesh *)o;
  __pyx_ptype_3ode_GeomObject->tp_clear(o);
  Py_XDECREF(((PyObject *)p->data));
  p->data = ((struct __pyx_obj_3ode_TriMeshData *)Py_None); Py_INCREF(Py_None);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_GeomTriMesh[] = {
  {"placeable", (PyCFunction)__pyx_f_3ode_11GeomTriMesh_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {"_id", (PyCFunction)__pyx_f_3ode_11GeomTriMesh__id, METH_VARARGS|METH_KEYWORDS, 0},
  {"clearTCCache", (PyCFunction)__pyx_f_3ode_11GeomTriMesh_clearTCCache, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11GeomTriMesh_clearTCCache},
  {"getTriangle", (PyCFunction)__pyx_f_3ode_11GeomTriMesh_getTriangle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_11GeomTriMesh_getTriangle},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_GeomTriMesh = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_GeomTriMesh = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_GeomTriMesh = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_GeomTriMesh = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_3ode_GeomTriMesh = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.GeomTriMesh", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_GeomTriMesh), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_GeomTriMesh, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_GeomTriMesh, /*tp_as_number*/
  &__pyx_tp_as_sequence_GeomTriMesh, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_GeomTriMesh, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_GeomTriMesh, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "TriMesh object.\n\n    To construct the trimesh geom you need a TriMeshData object that\n    stores the actual mesh. This object has to be passed as first\n    argument to the constructor.\n\n    Constructor::\n    \n      GeomTriMesh(data, space=None)    \n    ", /*tp_doc*/
  __pyx_tp_traverse_3ode_GeomTriMesh, /*tp_traverse*/
  __pyx_tp_clear_3ode_GeomTriMesh, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_GeomTriMesh, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_3ode_11GeomTriMesh___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_GeomTriMesh, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static struct PyMethodDef __pyx_methods[] = {
  {"Space", (PyCFunction)__pyx_f_3ode_Space, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_Space},
  {"collide", (PyCFunction)__pyx_f_3ode_collide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_collide},
  {"collide2", (PyCFunction)__pyx_f_3ode_collide2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_collide2},
  {"areConnected", (PyCFunction)__pyx_f_3ode_areConnected, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_areConnected},
  {"CloseODE", (PyCFunction)__pyx_f_3ode_CloseODE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_CloseODE},
  {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

PyMODINIT_FUNC initode(void); /*proto*/
PyMODINIT_FUNC initode(void) {
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  PyObject *__pyx_8 = 0;
  PyObject *__pyx_9 = 0;
  PyObject *__pyx_10 = 0;
  PyObject *__pyx_11 = 0;
  PyObject *__pyx_12 = 0;
  PyObject *__pyx_13 = 0;
  PyObject *__pyx_14 = 0;
  PyObject *__pyx_15 = 0;
  PyObject *__pyx_16 = 0;
  PyObject *__pyx_17 = 0;
  PyObject *__pyx_18 = 0;
  PyObject *__pyx_19 = 0;
  PyObject *__pyx_20 = 0;
  __pyx_init_filenames();
  __pyx_m = Py_InitModule4("ode", __pyx_methods, 0, 0, PYTHON_API_VERSION);
  if (!__pyx_m) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 26; goto __pyx_L1;};
  __pyx_b = PyImport_AddModule("__builtin__");
  if (!__pyx_b) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 26; goto __pyx_L1;};
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 26; goto __pyx_L1;};
  if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 26; goto __pyx_L1;};
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 26; goto __pyx_L1;};
  if (PyType_Ready(&__pyx_type_3ode_Mass) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Mass", (PyObject *)&__pyx_type_3ode_Mass) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_ptype_3ode_Mass = &__pyx_type_3ode_Mass;
  if (PyType_Ready(&__pyx_type_3ode_Contact) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Contact", (PyObject *)&__pyx_type_3ode_Contact) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; goto __pyx_L1;}
  __pyx_ptype_3ode_Contact = &__pyx_type_3ode_Contact;
  if (PyType_Ready(&__pyx_type_3ode_World) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "World", (PyObject *)&__pyx_type_3ode_World) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; goto __pyx_L1;}
  __pyx_ptype_3ode_World = &__pyx_type_3ode_World;
  __pyx_type_3ode_Body.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_3ode_Body) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 23; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Body", (PyObject *)&__pyx_type_3ode_Body) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 23; goto __pyx_L1;}
  __pyx_ptype_3ode_Body = &__pyx_type_3ode_Body;
  __pyx_type_3ode_JointGroup.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_3ode_JointGroup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 37; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "JointGroup", (PyObject *)&__pyx_type_3ode_JointGroup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 37; goto __pyx_L1;}
  __pyx_ptype_3ode_JointGroup = &__pyx_type_3ode_JointGroup;
  __pyx_type_3ode_Joint.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_3ode_Joint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Joint", (PyObject *)&__pyx_type_3ode_Joint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; goto __pyx_L1;}
  __pyx_ptype_3ode_Joint = &__pyx_type_3ode_Joint;
  __pyx_type_3ode_BallJoint.tp_base = __pyx_ptype_3ode_Joint;
  if (PyType_Ready(&__pyx_type_3ode_BallJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 258; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "BallJoint", (PyObject *)&__pyx_type_3ode_BallJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 258; goto __pyx_L1;}
  __pyx_ptype_3ode_BallJoint = &__pyx_type_3ode_BallJoint;
  __pyx_type_3ode_HingeJoint.tp_base = __pyx_ptype_3ode_Joint;
  if (PyType_Ready(&__pyx_type_3ode_HingeJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 330; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "HingeJoint", (PyObject *)&__pyx_type_3ode_HingeJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 330; goto __pyx_L1;}
  __pyx_ptype_3ode_HingeJoint = &__pyx_type_3ode_HingeJoint;
  __pyx_type_3ode_SliderJoint.tp_base = __pyx_ptype_3ode_Joint;
  if (PyType_Ready(&__pyx_type_3ode_SliderJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 484; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "SliderJoint", (PyObject *)&__pyx_type_3ode_SliderJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 484; goto __pyx_L1;}
  __pyx_ptype_3ode_SliderJoint = &__pyx_type_3ode_SliderJoint;
  __pyx_type_3ode_UniversalJoint.tp_base = __pyx_ptype_3ode_Joint;
  if (PyType_Ready(&__pyx_type_3ode_UniversalJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 570; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "UniversalJoint", (PyObject *)&__pyx_type_3ode_UniversalJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 570; goto __pyx_L1;}
  __pyx_ptype_3ode_UniversalJoint = &__pyx_type_3ode_UniversalJoint;
  __pyx_type_3ode_Hinge2Joint.tp_base = __pyx_ptype_3ode_Joint;
  if (PyType_Ready(&__pyx_type_3ode_Hinge2Joint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 697; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Hinge2Joint", (PyObject *)&__pyx_type_3ode_Hinge2Joint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 697; goto __pyx_L1;}
  __pyx_ptype_3ode_Hinge2Joint = &__pyx_type_3ode_Hinge2Joint;
  __pyx_type_3ode_FixedJoint.tp_base = __pyx_ptype_3ode_Joint;
  if (PyType_Ready(&__pyx_type_3ode_FixedJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 853; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "FixedJoint", (PyObject *)&__pyx_type_3ode_FixedJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 853; goto __pyx_L1;}
  __pyx_ptype_3ode_FixedJoint = &__pyx_type_3ode_FixedJoint;
  __pyx_type_3ode_ContactJoint.tp_base = __pyx_ptype_3ode_Joint;
  if (PyType_Ready(&__pyx_type_3ode_ContactJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 888; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "ContactJoint", (PyObject *)&__pyx_type_3ode_ContactJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 888; goto __pyx_L1;}
  __pyx_ptype_3ode_ContactJoint = &__pyx_type_3ode_ContactJoint;
  __pyx_type_3ode_AMotor.tp_base = __pyx_ptype_3ode_Joint;
  if (PyType_Ready(&__pyx_type_3ode_AMotor) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 911; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "AMotor", (PyObject *)&__pyx_type_3ode_AMotor) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 911; goto __pyx_L1;}
  __pyx_ptype_3ode_AMotor = &__pyx_type_3ode_AMotor;
  __pyx_type_3ode_LMotor.tp_base = __pyx_ptype_3ode_Joint;
  if (PyType_Ready(&__pyx_type_3ode_LMotor) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1084; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "LMotor", (PyObject *)&__pyx_type_3ode_LMotor) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1084; goto __pyx_L1;}
  __pyx_ptype_3ode_LMotor = &__pyx_type_3ode_LMotor;
  __pyx_type_3ode_Plane2DJoint.tp_base = __pyx_ptype_3ode_Joint;
  if (PyType_Ready(&__pyx_type_3ode_Plane2DJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1173; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Plane2DJoint", (PyObject *)&__pyx_type_3ode_Plane2DJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1173; goto __pyx_L1;}
  __pyx_ptype_3ode_Plane2DJoint = &__pyx_type_3ode_Plane2DJoint;
  __pyx_type_3ode_GeomObject.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_3ode_GeomObject) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 39; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomObject", (PyObject *)&__pyx_type_3ode_GeomObject) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 39; goto __pyx_L1;}
  __pyx_ptype_3ode_GeomObject = &__pyx_type_3ode_GeomObject;
  __pyx_type_3ode_SpaceBase.tp_base = __pyx_ptype_3ode_GeomObject;
  if (PyType_Ready(&__pyx_type_3ode_SpaceBase) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 44; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "SpaceBase", (PyObject *)&__pyx_type_3ode_SpaceBase) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 44; goto __pyx_L1;}
  __pyx_ptype_3ode_SpaceBase = &__pyx_type_3ode_SpaceBase;
  __pyx_type_3ode_SimpleSpace.tp_base = __pyx_ptype_3ode_SpaceBase;
  if (PyType_Ready(&__pyx_type_3ode_SimpleSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 221; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "SimpleSpace", (PyObject *)&__pyx_type_3ode_SimpleSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 221; goto __pyx_L1;}
  __pyx_ptype_3ode_SimpleSpace = &__pyx_type_3ode_SimpleSpace;
  __pyx_type_3ode_HashSpace.tp_base = __pyx_ptype_3ode_SpaceBase;
  if (PyType_Ready(&__pyx_type_3ode_HashSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 254; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "HashSpace", (PyObject *)&__pyx_type_3ode_HashSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 254; goto __pyx_L1;}
  __pyx_ptype_3ode_HashSpace = &__pyx_type_3ode_HashSpace;
  __pyx_type_3ode_QuadTreeSpace.tp_base = __pyx_ptype_3ode_SpaceBase;
  if (PyType_Ready(&__pyx_type_3ode_QuadTreeSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 314; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "QuadTreeSpace", (PyObject *)&__pyx_type_3ode_QuadTreeSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 314; goto __pyx_L1;}
  __pyx_ptype_3ode_QuadTreeSpace = &__pyx_type_3ode_QuadTreeSpace;
  __pyx_type_3ode_GeomSphere.tp_base = __pyx_ptype_3ode_GeomObject;
  if (PyType_Ready(&__pyx_type_3ode_GeomSphere) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 23; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomSphere", (PyObject *)&__pyx_type_3ode_GeomSphere) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 23; goto __pyx_L1;}
  __pyx_ptype_3ode_GeomSphere = &__pyx_type_3ode_GeomSphere;
  __pyx_type_3ode_GeomBox.tp_base = __pyx_ptype_3ode_GeomObject;
  if (PyType_Ready(&__pyx_type_3ode_GeomBox) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 92; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomBox", (PyObject *)&__pyx_type_3ode_GeomBox) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 92; goto __pyx_L1;}
  __pyx_ptype_3ode_GeomBox = &__pyx_type_3ode_GeomBox;
  __pyx_type_3ode_GeomPlane.tp_base = __pyx_ptype_3ode_GeomObject;
  if (PyType_Ready(&__pyx_type_3ode_GeomPlane) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 151; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomPlane", (PyObject *)&__pyx_type_3ode_GeomPlane) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 151; goto __pyx_L1;}
  __pyx_ptype_3ode_GeomPlane = &__pyx_type_3ode_GeomPlane;
  __pyx_type_3ode_GeomCapsule.tp_base = __pyx_ptype_3ode_GeomObject;
  if (PyType_Ready(&__pyx_type_3ode_GeomCapsule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 213; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomCapsule", (PyObject *)&__pyx_type_3ode_GeomCapsule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 213; goto __pyx_L1;}
  __pyx_ptype_3ode_GeomCapsule = &__pyx_type_3ode_GeomCapsule;
  __pyx_type_3ode_GeomCylinder.tp_base = __pyx_ptype_3ode_GeomObject;
  if (PyType_Ready(&__pyx_type_3ode_GeomCylinder) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomCylinder", (PyObject *)&__pyx_type_3ode_GeomCylinder) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; goto __pyx_L1;}
  __pyx_ptype_3ode_GeomCylinder = &__pyx_type_3ode_GeomCylinder;
  __pyx_type_3ode_GeomRay.tp_base = __pyx_ptype_3ode_GeomObject;
  if (PyType_Ready(&__pyx_type_3ode_GeomRay) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 326; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomRay", (PyObject *)&__pyx_type_3ode_GeomRay) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 326; goto __pyx_L1;}
  __pyx_ptype_3ode_GeomRay = &__pyx_type_3ode_GeomRay;
  __pyx_type_3ode_GeomTransform.tp_base = __pyx_ptype_3ode_GeomObject;
  __pyx_type_3ode_GeomTransform.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_3ode_GeomTransform) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 381; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomTransform", (PyObject *)&__pyx_type_3ode_GeomTransform) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 381; goto __pyx_L1;}
  __pyx_ptype_3ode_GeomTransform = &__pyx_type_3ode_GeomTransform;
  if (PyType_Ready(&__pyx_type_3ode_TriMeshData) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 22; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "TriMeshData", (PyObject *)&__pyx_type_3ode_TriMeshData) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_ptype_3ode_TriMeshData = &__pyx_type_3ode_TriMeshData;
  __pyx_type_3ode_GeomTriMesh.tp_base = __pyx_ptype_3ode_GeomObject;
  __pyx_type_3ode_GeomTriMesh.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_3ode_GeomTriMesh) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 26; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomTriMesh", (PyObject *)&__pyx_type_3ode_GeomTriMesh) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 26; goto __pyx_L1;}
  __pyx_ptype_3ode_GeomTriMesh = &__pyx_type_3ode_GeomTriMesh;

  /* "/home/zefiris/pyode/src/ode.pyx":33 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n___doc__, __pyx_k1p) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 33; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/ode.pyx":81 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 81; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramLoStop, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 81; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":82 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 82; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramHiStop, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 82; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":83 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 83; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramVel, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 83; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":84 */
  __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 84; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramFMax, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 84; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":85 */
  __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 85; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramFudgeFactor, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 85; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":86 */
  __pyx_1 = PyInt_FromLong(5); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 86; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramBounce, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 86; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":87 */
  __pyx_1 = PyInt_FromLong(6); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 87; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramCFM, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 87; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":88 */
  __pyx_1 = PyInt_FromLong(7); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 88; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramStopERP, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 88; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":89 */
  __pyx_1 = PyInt_FromLong(8); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 89; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramStopCFM, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 89; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":90 */
  __pyx_1 = PyInt_FromLong(9); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 90; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramSuspensionERP, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 90; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":91 */
  __pyx_1 = PyInt_FromLong(10); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 91; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramSuspensionCFM, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 91; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":93 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 93; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamLoStop, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 93; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":94 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamHiStop, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":95 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 95; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamVel, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 95; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":96 */
  __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 96; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamFMax, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 96; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":97 */
  __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 97; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamFudgeFactor, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 97; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":98 */
  __pyx_1 = PyInt_FromLong(5); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 98; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamBounce, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 98; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":99 */
  __pyx_1 = PyInt_FromLong(6); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 99; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamCFM, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 99; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":100 */
  __pyx_1 = PyInt_FromLong(7); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 100; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamStopERP, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 100; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":101 */
  __pyx_1 = PyInt_FromLong(8); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 101; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamStopCFM, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 101; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":102 */
  __pyx_1 = PyInt_FromLong(9); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 102; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamSuspensionERP, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 102; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":103 */
  __pyx_1 = PyInt_FromLong(10); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamSuspensionCFM, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":105 */
  __pyx_1 = PyInt_FromLong((256 + 0)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 105; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamLoStop2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 105; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":106 */
  __pyx_1 = PyInt_FromLong((256 + 1)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 106; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamHiStop2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 106; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":107 */
  __pyx_1 = PyInt_FromLong((256 + 2)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamVel2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":108 */
  __pyx_1 = PyInt_FromLong((256 + 3)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamFMax2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":109 */
  __pyx_1 = PyInt_FromLong((256 + 4)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamFudgeFactor2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":110 */
  __pyx_1 = PyInt_FromLong((256 + 5)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamBounce2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":111 */
  __pyx_1 = PyInt_FromLong((256 + 6)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamCFM2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":112 */
  __pyx_1 = PyInt_FromLong((256 + 7)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamStopERP2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":113 */
  __pyx_1 = PyInt_FromLong((256 + 8)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamStopCFM2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":114 */
  __pyx_1 = PyInt_FromLong((256 + 9)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamSuspensionERP2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":115 */
  __pyx_1 = PyInt_FromLong((256 + 10)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamSuspensionCFM2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":117 */
  __pyx_1 = PyInt_FromLong((512 + 0)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 117; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamLoStop3, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 117; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":118 */
  __pyx_1 = PyInt_FromLong((512 + 1)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamHiStop3, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":119 */
  __pyx_1 = PyInt_FromLong((512 + 2)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamVel3, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":120 */
  __pyx_1 = PyInt_FromLong((512 + 3)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 120; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamFMax3, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 120; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":121 */
  __pyx_1 = PyInt_FromLong((512 + 4)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamFudgeFactor3, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":122 */
  __pyx_1 = PyInt_FromLong((512 + 5)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamBounce3, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":123 */
  __pyx_1 = PyInt_FromLong((512 + 6)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 123; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamCFM3, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 123; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":124 */
  __pyx_1 = PyInt_FromLong((512 + 7)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamStopERP3, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":125 */
  __pyx_1 = PyInt_FromLong((512 + 8)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamStopCFM3, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":126 */
  __pyx_1 = PyInt_FromLong((512 + 9)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 126; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamSuspensionERP3, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 126; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":127 */
  __pyx_1 = PyInt_FromLong((512 + 10)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 127; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamSuspensionCFM3, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 127; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":129 */
  __pyx_1 = PyInt_FromLong(256); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 129; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamGroup, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 129; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":131 */
  __pyx_1 = PyInt_FromLong(0x001); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 131; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactMu2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 131; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":132 */
  __pyx_1 = PyInt_FromLong(0x002); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 132; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactFDir1, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 132; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":133 */
  __pyx_1 = PyInt_FromLong(0x004); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 133; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactBounce, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 133; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":134 */
  __pyx_1 = PyInt_FromLong(0x008); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 134; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactSoftERP, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 134; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":135 */
  __pyx_1 = PyInt_FromLong(0x010); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 135; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactSoftCFM, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 135; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":136 */
  __pyx_1 = PyInt_FromLong(0x020); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 136; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactMotion1, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 136; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":137 */
  __pyx_1 = PyInt_FromLong(0x040); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 137; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactMotion2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 137; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":138 */
  __pyx_1 = PyInt_FromLong(0x080); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 138; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactSlip1, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 138; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":139 */
  __pyx_1 = PyInt_FromLong(0x100); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 139; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactSlip2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 139; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":141 */
  __pyx_1 = PyInt_FromLong(0x0000); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 141; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactApprox0, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 141; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":142 */
  __pyx_1 = PyInt_FromLong(0x1000); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 142; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactApprox1_1, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 142; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":143 */
  __pyx_1 = PyInt_FromLong(0x2000); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 143; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactApprox1_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 143; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":144 */
  __pyx_1 = PyInt_FromLong(0x3000); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 144; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactApprox1, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 144; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":146 */
  __pyx_1 = PyInt_FromLong(dAMotorUser); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 146; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_AMotorUser, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 146; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":147 */
  __pyx_1 = PyInt_FromLong(dAMotorEuler); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 147; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_AMotorEuler, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":149 */
  __pyx_1 = PyFloat_FromDouble(dInfinity); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 149; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_Infinity, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 149; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/ode.pyx":154 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 154; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n__geom_c2py_lut, __pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 154; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/contact.pyx":309 */
  Py_INCREF(Py_None);
  __pyx_k2 = Py_None;
  Py_INCREF(Py_None);
  __pyx_k3 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":202 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 202; goto __pyx_L1;}
  __pyx_k4 = __pyx_1;
  __pyx_1 = 0;

  /* "/home/zefiris/pyode/src/joints.pyx":266 */
  Py_INCREF(Py_None);
  __pyx_k5 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":276 */
  Py_INCREF(Py_None);
  __pyx_k6 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":338 */
  Py_INCREF(Py_None);
  __pyx_k7 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":348 */
  Py_INCREF(Py_None);
  __pyx_k8 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":492 */
  Py_INCREF(Py_None);
  __pyx_k9 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":502 */
  Py_INCREF(Py_None);
  __pyx_k10 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":578 */
  Py_INCREF(Py_None);
  __pyx_k11 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":588 */
  Py_INCREF(Py_None);
  __pyx_k12 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":705 */
  Py_INCREF(Py_None);
  __pyx_k13 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":715 */
  Py_INCREF(Py_None);
  __pyx_k14 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":861 */
  Py_INCREF(Py_None);
  __pyx_k15 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":871 */
  Py_INCREF(Py_None);
  __pyx_k16 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":919 */
  Py_INCREF(Py_None);
  __pyx_k17 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":929 */
  Py_INCREF(Py_None);
  __pyx_k18 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":1092 */
  Py_INCREF(Py_None);
  __pyx_k19 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":1102 */
  Py_INCREF(Py_None);
  __pyx_k20 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":1181 */
  Py_INCREF(Py_None);
  __pyx_k21 = Py_None;

  /* "/home/zefiris/pyode/src/joints.pyx":1191 */
  Py_INCREF(Py_None);
  __pyx_k22 = Py_None;

  /* "/home/zefiris/pyode/src/space.pyx":23 */
  __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 23; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 23; goto __pyx_L1;}
  if (PyDict_SetItemString(__pyx_2, "__doc__", __pyx_k24p) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 23; goto __pyx_L1;}
  __pyx_4 = __Pyx_CreateClass(__pyx_3, __pyx_2, __pyx_n__SpaceIterator, "ode"); if (!__pyx_4) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 23; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/zefiris/pyode/src/space.pyx":27 */
  __pyx_3 = PyCFunction_New(&__pyx_mdef_3ode_14_SpaceIterator___init__, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 27; goto __pyx_L1;}
  __pyx_5 = PyMethod_New(__pyx_3, 0, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 27; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyObject_SetAttr(__pyx_4, __pyx_n___init__, __pyx_5) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 27; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;

  /* "/home/zefiris/pyode/src/space.pyx":31 */
  __pyx_3 = PyCFunction_New(&__pyx_mdef_3ode_14_SpaceIterator___iter__, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 31; goto __pyx_L1;}
  __pyx_5 = PyMethod_New(__pyx_3, 0, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyObject_SetAttr(__pyx_4, __pyx_n___iter__, __pyx_5) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;

  /* "/home/zefiris/pyode/src/space.pyx":34 */
  __pyx_3 = PyCFunction_New(&__pyx_mdef_3ode_14_SpaceIterator_next, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 34; goto __pyx_L1;}
  __pyx_5 = PyMethod_New(__pyx_3, 0, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 34; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyObject_SetAttr(__pyx_4, __pyx_n_next, __pyx_5) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 34; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n__SpaceIterator, __pyx_4) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 23; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/zefiris/pyode/src/space.pyx":233 */
  Py_INCREF(Py_None);
  __pyx_k25 = Py_None;

  /* "/home/zefiris/pyode/src/space.pyx":250 */
  Py_INCREF(Py_None);
  __pyx_k26 = Py_None;

  /* "/home/zefiris/pyode/src/space.pyx":266 */
  Py_INCREF(Py_None);
  __pyx_k27 = Py_None;

  /* "/home/zefiris/pyode/src/space.pyx":283 */
  Py_INCREF(Py_None);
  __pyx_k28 = Py_None;

  /* "/home/zefiris/pyode/src/space.pyx":325 */
  Py_INCREF(Py_None);
  __pyx_k29 = Py_None;

  /* "/home/zefiris/pyode/src/space.pyx":350 */
  Py_INCREF(Py_None);
  __pyx_k30 = Py_None;

  /* "/home/zefiris/pyode/src/space.pyx":354 */
  __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 354; goto __pyx_L1;}
  __pyx_k31 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/zefiris/pyode/src/geoms.pyx":33 */
  Py_INCREF(Py_None);
  __pyx_k32 = Py_None;
  __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 33; goto __pyx_L1;}
  __pyx_k33 = __pyx_5;
  __pyx_5 = 0;

  /* "/home/zefiris/pyode/src/geoms.pyx":48 */
  Py_INCREF(Py_None);
  __pyx_k34 = Py_None;
  __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 48; goto __pyx_L1;}
  __pyx_k35 = __pyx_4;
  __pyx_4 = 0;

  /* "/home/zefiris/pyode/src/geoms.pyx":102 */
  Py_INCREF(Py_None);
  __pyx_k36 = Py_None;
  __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 102; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 102; goto __pyx_L1;}
  __pyx_7 = PyFloat_FromDouble(1.0); if (!__pyx_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 102; goto __pyx_L1;}
  __pyx_8 = PyTuple_New(3); if (!__pyx_8) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 102; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_8, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_8, 1, __pyx_6);
  PyTuple_SET_ITEM(__pyx_8, 2, __pyx_7);
  __pyx_2 = 0;
  __pyx_6 = 0;
  __pyx_7 = 0;
  __pyx_k37 = __pyx_8;
  __pyx_8 = 0;

  /* "/home/zefiris/pyode/src/geoms.pyx":116 */
  Py_INCREF(Py_None);
  __pyx_k38 = Py_None;
  __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; goto __pyx_L1;}
  __pyx_7 = PyFloat_FromDouble(1.0); if (!__pyx_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; goto __pyx_L1;}
  __pyx_9 = PyTuple_New(3); if (!__pyx_9) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_9, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_9, 1, __pyx_6);
  PyTuple_SET_ITEM(__pyx_9, 2, __pyx_7);
  __pyx_2 = 0;
  __pyx_6 = 0;
  __pyx_7 = 0;
  __pyx_k39 = __pyx_9;
  __pyx_9 = 0;

  /* "/home/zefiris/pyode/src/geoms.pyx":166 */
  Py_INCREF(Py_None);
  __pyx_k40 = Py_None;
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 166; goto __pyx_L1;}
  __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 166; goto __pyx_L1;}
  __pyx_7 = PyInt_FromLong(1); if (!__pyx_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 166; goto __pyx_L1;}
  __pyx_10 = PyTuple_New(3); if (!__pyx_10) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 166; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_10, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_10, 1, __pyx_6);
  PyTuple_SET_ITEM(__pyx_10, 2, __pyx_7);
  __pyx_2 = 0;
  __pyx_6 = 0;
  __pyx_7 = 0;
  __pyx_k41 = __pyx_10;
  __pyx_10 = 0;
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 166; goto __pyx_L1;}
  __pyx_k42 = __pyx_2;
  __pyx_2 = 0;

  /* "/home/zefiris/pyode/src/geoms.pyx":181 */
  Py_INCREF(Py_None);
  __pyx_k43 = Py_None;
  __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 181; goto __pyx_L1;}
  __pyx_7 = PyInt_FromLong(0); if (!__pyx_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 181; goto __pyx_L1;}
  __pyx_11 = PyInt_FromLong(1); if (!__pyx_11) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 181; goto __pyx_L1;}
  __pyx_12 = PyTuple_New(3); if (!__pyx_12) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 181; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_12, 0, __pyx_6);
  PyTuple_SET_ITEM(__pyx_12, 1, __pyx_7);
  PyTuple_SET_ITEM(__pyx_12, 2, __pyx_11);
  __pyx_6 = 0;
  __pyx_7 = 0;
  __pyx_11 = 0;
  __pyx_k44 = __pyx_12;
  __pyx_12 = 0;
  __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 181; goto __pyx_L1;}
  __pyx_k45 = __pyx_6;
  __pyx_6 = 0;

  /* "/home/zefiris/pyode/src/geoms.pyx":226 */
  Py_INCREF(Py_None);
  __pyx_k46 = Py_None;
  __pyx_7 = PyFloat_FromDouble(0.5); if (!__pyx_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 226; goto __pyx_L1;}
  __pyx_k47 = __pyx_7;
  __pyx_7 = 0;
  __pyx_11 = PyFloat_FromDouble(1.0); if (!__pyx_11) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 226; goto __pyx_L1;}
  __pyx_k48 = __pyx_11;
  __pyx_11 = 0;

  /* "/home/zefiris/pyode/src/geoms.pyx":240 */
  Py_INCREF(Py_None);
  __pyx_k49 = Py_None;
  __pyx_13 = PyFloat_FromDouble(0.5); if (!__pyx_13) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 240; goto __pyx_L1;}
  __pyx_k50 = __pyx_13;
  __pyx_13 = 0;
  __pyx_14 = PyFloat_FromDouble(1.0); if (!__pyx_14) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 240; goto __pyx_L1;}
  __pyx_k51 = __pyx_14;
  __pyx_14 = 0;

  /* "/home/zefiris/pyode/src/geoms.pyx":273 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_GeomCCylinder, ((PyObject*)__pyx_ptype_3ode_GeomCapsule)) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 273; goto __pyx_L1;}

  /* "/home/zefiris/pyode/src/geoms.pyx":288 */
  Py_INCREF(Py_None);
  __pyx_k52 = Py_None;
  __pyx_15 = PyFloat_FromDouble(0.5); if (!__pyx_15) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 288; goto __pyx_L1;}
  __pyx_k53 = __pyx_15;
  __pyx_15 = 0;
  __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 288; goto __pyx_L1;}
  __pyx_k54 = __pyx_16;
  __pyx_16 = 0;

  /* "/home/zefiris/pyode/src/geoms.pyx":302 */
  Py_INCREF(Py_None);
  __pyx_k55 = Py_None;
  __pyx_17 = PyFloat_FromDouble(0.5); if (!__pyx_17) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 302; goto __pyx_L1;}
  __pyx_k56 = __pyx_17;
  __pyx_17 = 0;
  __pyx_18 = PyFloat_FromDouble(1.0); if (!__pyx_18) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 302; goto __pyx_L1;}
  __pyx_k57 = __pyx_18;
  __pyx_18 = 0;

  /* "/home/zefiris/pyode/src/geoms.pyx":340 */
  Py_INCREF(Py_None);
  __pyx_k58 = Py_None;
  __pyx_19 = PyFloat_FromDouble(1.0); if (!__pyx_19) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 340; goto __pyx_L1;}
  __pyx_k59 = __pyx_19;
  __pyx_19 = 0;

  /* "/home/zefiris/pyode/src/geoms.pyx":355 */
  Py_INCREF(Py_None);
  __pyx_k60 = Py_None;
  __pyx_20 = PyFloat_FromDouble(1.0); if (!__pyx_20) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 355; goto __pyx_L1;}
  __pyx_k61 = __pyx_20;
  __pyx_20 = 0;

  /* "/home/zefiris/pyode/src/geoms.pyx":395 */
  Py_INCREF(Py_None);
  __pyx_k62 = Py_None;

  /* "/home/zefiris/pyode/src/geoms.pyx":412 */
  Py_INCREF(Py_None);
  __pyx_k63 = Py_None;

  /* "src/trimesh.pyx":41 */
  Py_INCREF(Py_None);
  __pyx_k64 = Py_None;

  /* "src/trimesh.pyx":56 */
  Py_INCREF(Py_None);
  __pyx_k65 = Py_None;

  /* "/home/zefiris/pyode/src/ode.pyx":292 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_environment, Py_None) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 292; goto __pyx_L1;}
  return;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  Py_XDECREF(__pyx_8);
  Py_XDECREF(__pyx_9);
  Py_XDECREF(__pyx_10);
  Py_XDECREF(__pyx_11);
  Py_XDECREF(__pyx_12);
  Py_XDECREF(__pyx_13);
  Py_XDECREF(__pyx_14);
  Py_XDECREF(__pyx_15);
  Py_XDECREF(__pyx_16);
  Py_XDECREF(__pyx_17);
  Py_XDECREF(__pyx_18);
  Py_XDECREF(__pyx_19);
  Py_XDECREF(__pyx_20);
  __Pyx_AddTraceback("ode");
}

static char *__pyx_filenames[] = {
  "mass.pyx",
  "contact.pyx",
  "world.pyx",
  "body.pyx",
  "joints.pyx",
  "geomobject.pyx",
  "space.pyx",
  "geoms.pyx",
  "trimeshdata.pyx",
  "trimesh.pyx",
  "ode.pyx",
};

/* Runtime support code */

static void __pyx_init_filenames(void) {
  __pyx_f = __pyx_filenames;
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name) {
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if ((none_allowed && obj == Py_None) || PyObject_TypeCheck(obj, type))
        return 1;
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, obj->ob_type->tp_name);
    return 0;
}

static int __Pyx_GetStarArgs(
    PyObject **args, 
    PyObject **kwds,
    char *kwd_list[], 
    int nargs,
    PyObject **args2, 
    PyObject **kwds2)
{
    PyObject *x = 0, *args1 = 0, *kwds1 = 0;
    
    if (args2)
        *args2 = 0;
    if (kwds2)
        *kwds2 = 0;
    
    if (args2) {
        args1 = PyTuple_GetSlice(*args, 0, nargs);
        if (!args1)
            goto bad;
        *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_Size(*args));
        if (!*args2)
            goto bad;
    }
    else {
        args1 = *args;
        Py_INCREF(args1);
    }
    
    if (kwds2) {
        if (*kwds) {
            char **p;
            kwds1 = PyDict_New();
            if (!kwds)
                goto bad;
            *kwds2 = PyDict_Copy(*kwds);
            if (!*kwds2)
                goto bad;
            for (p = kwd_list; *p; p++) {
                x = PyDict_GetItemString(*kwds, *p);
                if (x) {
                    if (PyDict_SetItemString(kwds1, *p, x) < 0)
                        goto bad;
                    if (PyDict_DelItemString(*kwds2, *p) < 0)
                        goto bad;
                }
            }
        }
        else {
            *kwds2 = PyDict_New();
            if (!*kwds2)
                goto bad;
        }
    }
    else {
        kwds1 = *kwds;
        Py_XINCREF(kwds1);
    }
    
    *args = args1;
    *kwds = kwds1;
    return 0;
bad:
    Py_XDECREF(args1);
    Py_XDECREF(kwds1);
    if (*args2) {
        Py_XDECREF(*args2);
    }
    if (*kwds2) {
        Py_XDECREF(*kwds2);
    }
    return -1;
}

static PyObject *__Pyx_CreateClass(
    PyObject *bases, PyObject *dict, PyObject *name, char *modname)
{
    PyObject *py_modname;
    PyObject *result = 0;
    
    py_modname = PyString_FromString(modname);
    if (!py_modname)
        goto bad;
    if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
        goto bad;
    result = PyClass_New(bases, dict, name);
bad:
    Py_XDECREF(py_modname);
    return result;
}

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result)
        PyErr_SetObject(PyExc_NameError, name);
    return result;
}

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    /* First, check the traceback argument, replacing None with NULL. */
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    /* Next, replace a missing value with None */
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    /* Next, repeatedly, replace a tuple exception with its first item */
    while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {
        PyObject *tmp = type;
        type = PyTuple_GET_ITEM(type, 0);
        Py_INCREF(type);
        Py_DECREF(tmp);
    }
    if (PyString_Check(type)) {
        if (PyErr_Warn(PyExc_DeprecationWarning,
                "raising a string exception is deprecated"))
            goto raise_error;
    }
    else if (PyType_Check(type) || PyClass_Check(type))
        ; /*PyErr_NormalizeException(&type, &value, &tb);*/
    else {
        /* Raising an instance.  The value should be a dummy. */
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        /* Normalize to raise <class>, <instance> */
        Py_DECREF(value);
        value = type;
        if (PyInstance_Check(type))
            type = (PyObject*) ((PyInstanceObject*)type)->in_class;
        else
            type = (PyObject*) type->ob_type;
        Py_INCREF(type);
    }
    PyErr_Restore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

static PyObject *__Pyx_GetExcValue(void) {
    PyObject *type = 0, *value = 0, *tb = 0;
    PyObject *result = 0;
    PyThreadState *tstate = PyThreadState_Get();
    PyErr_Fetch(&type, &value, &tb);
    PyErr_NormalizeException(&type, &value, &tb);
    if (PyErr_Occurred())
        goto bad;
    if (!value) {
        value = Py_None;
        Py_INCREF(value);
    }
    Py_XDECREF(tstate->exc_type);
    Py_XDECREF(tstate->exc_value);
    Py_XDECREF(tstate->exc_traceback);
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    result = value;
    Py_XINCREF(result);
    type = 0;
    value = 0;
    tb = 0;
bad:
    Py_XDECREF(type);
    Py_XDECREF(value);
    Py_XDECREF(tb);
    return result;
}

static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (obj == Py_None || PyObject_TypeCheck(obj, type))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s",
        obj->ob_type->tp_name, type->tp_name);
    return 0;
}

static void __Pyx_UnpackError(void) {
    PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size");
}

static PyObject *__Pyx_UnpackItem(PyObject *iter) {
    PyObject *item;
    if (!(item = PyIter_Next(iter))) {
        if (!PyErr_Occurred())
            __Pyx_UnpackError();
    }
    return item;
}

static int __Pyx_EndUnpack(PyObject *iter) {
    PyObject *item;
    if ((item = PyIter_Next(iter))) {
        Py_DECREF(item);
        __Pyx_UnpackError();
        return -1;
    }
    else if (!PyErr_Occurred())
        return 0;
    else
        return -1;
}

static void __Pyx_WriteUnraisable(char *name) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    PyErr_Fetch(&old_exc, &old_val, &old_tb);
    ctx = PyString_FromString(name);
    PyErr_Restore(old_exc, old_val, old_tb);
    if (!ctx)
        ctx = Py_None;
    PyErr_WriteUnraisable(ctx);
}

static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
    while (t->p) {
        *t->p = PyString_InternFromString(t->s);
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(char *funcname) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyObject *empty_tuple = 0;
    PyObject *empty_string = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    
    py_srcfile = PyString_FromString(__pyx_filename);
    if (!py_srcfile) goto bad;
    py_funcname = PyString_FromString(funcname);
    if (!py_funcname) goto bad;
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    empty_tuple = PyTuple_New(0);
    if (!empty_tuple) goto bad;
    empty_string = PyString_FromString("");
    if (!empty_string) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        empty_string, /*PyObject *code,*/
        empty_tuple,  /*PyObject *consts,*/
        empty_tuple,  /*PyObject *names,*/
        empty_tuple,  /*PyObject *varnames,*/
        empty_tuple,  /*PyObject *freevars,*/
        empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        __pyx_lineno,   /*int firstlineno,*/
        empty_string  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_Get(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    Py_XDECREF(empty_tuple);
    Py_XDECREF(empty_string);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
