/* Generated by Pyrex 0.9.3 on Wed Sep 15 23:14:22 2004 */

#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#include "ode/ode.h"
#include "malloc.h"
#include "string.h"
#include "math.h"


typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/
static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
static int __Pyx_PrintItem(PyObject *); /*proto*/
static int __Pyx_PrintNewline(void); /*proto*/
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static void __Pyx_ReRaise(void); /*proto*/
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
static PyObject *__Pyx_GetExcValue(void); /*proto*/
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
static void __Pyx_WriteUnraisable(char *name); /*proto*/
static void __Pyx_AddTraceback(char *funcname); /*proto*/
static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size);  /*proto*/
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

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

/* Declarations from ode */

staticforward PyTypeObject __pyx_type_3ode_GeomObject;

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

staticforward PyTypeObject __pyx_type_3ode_GeomLand;

struct __pyx_obj_3ode_GeomLand {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_Mass;

struct __pyx_obj_3ode_Mass {
  PyObject_HEAD
  dMass _mass;
};

staticforward PyTypeObject __pyx_type_3ode_Contact;

struct __pyx_obj_3ode_Contact {
  PyObject_HEAD
  dContact _contact;
};

staticforward PyTypeObject __pyx_type_3ode_World;

struct __pyx_obj_3ode_World {
  PyObject_HEAD
  dWorldID wid;
};

staticforward PyTypeObject __pyx_type_3ode_Body;

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

staticforward PyTypeObject __pyx_type_3ode_JointGroup;

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

staticforward PyTypeObject __pyx_type_3ode_Joint;

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

staticforward PyTypeObject __pyx_type_3ode_BallJoint;

struct __pyx_obj_3ode_BallJoint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_HingeJoint;

struct __pyx_obj_3ode_HingeJoint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_SliderJoint;

struct __pyx_obj_3ode_SliderJoint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_UniversalJoint;

struct __pyx_obj_3ode_UniversalJoint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_Hinge2Joint;

struct __pyx_obj_3ode_Hinge2Joint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_FixedJoint;

struct __pyx_obj_3ode_FixedJoint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_ContactJoint;

struct __pyx_obj_3ode_ContactJoint {
  struct __pyx_obj_3ode_Joint __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_AMotor;

struct __pyx_obj_3ode_AMotor {
  struct __pyx_obj_3ode_Joint __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_SpaceBase;

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

staticforward PyTypeObject __pyx_type_3ode_SimpleSpace;

struct __pyx_obj_3ode_SimpleSpace {
  struct __pyx_obj_3ode_SpaceBase __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_HashSpace;

struct __pyx_obj_3ode_HashSpace {
  struct __pyx_obj_3ode_SpaceBase __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_QuadTreeSpace;

struct __pyx_obj_3ode_QuadTreeSpace {
  struct __pyx_obj_3ode_SpaceBase __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_GeomSphere;

struct __pyx_obj_3ode_GeomSphere {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_GeomBox;

struct __pyx_obj_3ode_GeomBox {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_GeomPlane;

struct __pyx_obj_3ode_GeomPlane {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_GeomCCylinder;

struct __pyx_obj_3ode_GeomCCylinder {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_GeomRay;

struct __pyx_obj_3ode_GeomRay {
  struct __pyx_obj_3ode_GeomObject __pyx_base;
};

staticforward PyTypeObject __pyx_type_3ode_GeomTransform;

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

static PyTypeObject *__pyx_ptype_3ode_GeomObject = 0;
static PyTypeObject *__pyx_ptype_3ode_GeomLand = 0;
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_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_GeomCCylinder = 0;
static PyTypeObject *__pyx_ptype_3ode_GeomRay = 0;
static PyTypeObject *__pyx_ptype_3ode_GeomTransform = 0;
static dGeomClass __pyx_v_3ode_dLandGeomClass;
static int __pyx_v_3ode_dLandClass;
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_k23;
static PyObject *__pyx_k24;
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;
struct __pyx_obj_3ode_GeomLand *(_c2py_GeomLand(void (*))); /*proto*/
static void (__pyx_f_3ode_collide_callback(void (*),dGeomID ,dGeomID )); /*proto*/
static void (__pyx_f_3ode_LandGetAABB(dGeomID ,dReal (*))); /*proto*/
static int (__pyx_f_3ode_LandBoxCollide(dGeomID ,dGeomID ,int ,dContactGeom (*),int )); /*proto*/
static dColliderFn (*(__pyx_f_3ode_LandGetColliderFn(int ))); /*proto*/
static int (__pyx_f_3ode_LandAABBTest(dGeomID ,dGeomID ,dReal (*))); /*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\nGeom classes:\n\n - GeomSphere\n - GeomBox\n - GeomPlane\n - GeomCCylinder\n - GeomRay\n - GeomTransform\n - GeomTriMesh / TriMeshData\n\nFunctions:\n\n - CloseODE()\n - collide()\n\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_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_Space;
static PyObject *__pyx_n_collide;
static PyObject *__pyx_n_CloseODE;
static PyObject *__pyx_n_environment;

static PyObject *__pyx_k1p;

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/jiba/src/soya/ode/mass.pyx":25 */
  dMassSetZero((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass));

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Mass.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  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/jiba/src/soya/ode/mass.pyx":31 */
  dMassSetZero((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass));

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Mass.setZero");
  __pyx_r = 0;
  __pyx_L0:;
  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/jiba/src/soya/ode/mass.pyx":59 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_mass); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_cgx); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_cgy); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_cgz); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
  __pyx_5 = PyFloat_AsDouble(__pyx_v_I11); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
  __pyx_6 = PyFloat_AsDouble(__pyx_v_I22); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
  __pyx_7 = PyFloat_AsDouble(__pyx_v_I33); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
  __pyx_8 = PyFloat_AsDouble(__pyx_v_I12); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
  __pyx_9 = PyFloat_AsDouble(__pyx_v_I13); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
  __pyx_10 = PyFloat_AsDouble(__pyx_v_I23); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; 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(__pyx_r);
  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/jiba/src/soya/ode/mass.pyx":72 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_density); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;}
  dMassSetSphere((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_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/jiba/src/soya/ode/mass.pyx":94 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_density); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_v_direction); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_r); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_h); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; 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(__pyx_r);
  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_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/jiba/src/soya/ode/mass.pyx":115 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_density); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_v_direction); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_r); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_h); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; 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(__pyx_r);
  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_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/jiba/src/soya/ode/mass.pyx":134 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_density); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_lx); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_ly); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_lz); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; 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(__pyx_r);
  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_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/jiba/src/soya/ode/mass.pyx":148 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_newmass); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
  dMassAdjust((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/mass.pyx":160 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __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[0]; __pyx_lineno = 160; 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 = 160; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; 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 = 160; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; 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(__pyx_r);
  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 = 169; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/mass.pyx":178 */
  dMassAdd((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),(&__pyx_v_b->_mass));

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_k57p;
static PyObject *__pyx_k58p;

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

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/jiba/src/soya/ode/mass.pyx":181 */
  if (PyObject_Cmp(__pyx_v_name, __pyx_n_mass, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/mass.pyx":182 */
    __pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass.mass); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; 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 = 183; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/mass.pyx":184 */
    __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 = 184; 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 = 184; 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 = 184; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; 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 = 185; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/mass.pyx":186 */
    __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 = 186; 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 = 186; 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 = 186; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; 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 = 187; 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 = 187; 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 = 187; goto __pyx_L1;}
    __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; 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 = 188; 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 = 188; 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 = 188; goto __pyx_L1;}
    __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; 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 = 186; 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/jiba/src/soya/ode/mass.pyx":190 */
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
    __pyx_4 = PyNumber_Add(__pyx_k57p, __pyx_v_name); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
    __pyx_5 = PyNumber_Add(__pyx_4, __pyx_k58p); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; 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 = 190; goto __pyx_L1;}
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_k61p;
static PyObject *__pyx_k63p;
static PyObject *__pyx_k64p;
static PyObject *__pyx_k65p;

static char (__pyx_k61[]) = "Use the setParameter() method to change c";
static char (__pyx_k63[]) = "Use the setParameter() method to change I";
static char (__pyx_k64[]) = "Mass object has no attribute '";
static char (__pyx_k65[]) = "\'";

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/jiba/src/soya/ode/mass.pyx":193 */
  if (PyObject_Cmp(__pyx_v_name, __pyx_n_mass, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/mass.pyx":194 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_adjust); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; 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 = 195; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/mass.pyx":196 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k61p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; 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 = 197; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/mass.pyx":198 */
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
    __Pyx_Raise(__pyx_3, __pyx_k63p, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/mass.pyx":200 */
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;}
    __pyx_2 = PyNumber_Add(__pyx_k64p, __pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;}
    __pyx_3 = PyNumber_Add(__pyx_2, __pyx_k65p); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; 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 = 200; 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 = 202; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/mass.pyx":203 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_add); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; 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 = 203; 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/jiba/src/soya/ode/mass.pyx":204 */
  Py_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_k66p;

static char (__pyx_k66[]) = "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(__pyx_v_m);
  __pyx_v_sc0 = Py_None; Py_INCREF(__pyx_v_sc0);
  __pyx_v_sc1 = Py_None; Py_INCREF(__pyx_v_sc1);
  __pyx_v_sc2 = Py_None; Py_INCREF(__pyx_v_sc2);
  __pyx_v_I11 = Py_None; Py_INCREF(__pyx_v_I11);
  __pyx_v_I22 = Py_None; Py_INCREF(__pyx_v_I22);
  __pyx_v_I33 = Py_None; Py_INCREF(__pyx_v_I33);
  __pyx_v_I12 = Py_None; Py_INCREF(__pyx_v_I12);
  __pyx_v_I13 = Py_None; Py_INCREF(__pyx_v_I13);
  __pyx_v_I23 = Py_None; Py_INCREF(__pyx_v_I23);

  /* "/home/jiba/src/soya/ode/mass.pyx":207 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; 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 = 207; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; 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 = 207; 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/jiba/src/soya/ode/mass.pyx":208 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; 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 = 208; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; 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 = 208; 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/jiba/src/soya/ode/mass.pyx":209 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; 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 = 209; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; 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 = 209; 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/jiba/src/soya/ode/mass.pyx":210 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; 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/jiba/src/soya/ode/mass.pyx":211 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; 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 = 211; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; 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 = 211; 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/jiba/src/soya/ode/mass.pyx":212 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; 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 = 212; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; 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 = 212; 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/jiba/src/soya/ode/mass.pyx":213 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; 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 = 213; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; 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 = 213; 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/jiba/src/soya/ode/mass.pyx":214 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; 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 = 214; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; 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 = 214; 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/jiba/src/soya/ode/mass.pyx":215 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; 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 = 215; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; 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 = 215; 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/jiba/src/soya/ode/mass.pyx":216 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; 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 = 216; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; 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 = 216; 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/jiba/src/soya/ode/mass.pyx":217 */
  __pyx_1 = PyTuple_New(10); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; 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_k66p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; 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(__pyx_r);
  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/jiba/src/soya/ode/contact.pyx":22 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ContactBounce); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.mode = __pyx_2;

  /* "/home/jiba/src/soya/ode/contact.pyx":23 */
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.mu = dInfinity;

  /* "/home/jiba/src/soya/ode/contact.pyx":25 */
  ((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 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/jiba/src/soya/ode/contact.pyx":28 */
  __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 = 28; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 PyObject *__pyx_f_3ode_7Contact_setMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_m = 0;
  PyObject *__pyx_r;
  int __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/jiba/src/soya/ode/contact.pyx":31 */
  __pyx_1 = PyInt_AsLong(__pyx_v_m); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.mode = __pyx_1;

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

static PyObject *__pyx_f_3ode_7Contact_getMu(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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/jiba/src/soya/ode/contact.pyx":34 */
  __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 = 34; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":37 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_mu); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 37; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.mu = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":40 */
  __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 = 40; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":43 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_mu); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.mu2 = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":46 */
  __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 = 46; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":49 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_b); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.bounce = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":52 */
  __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 = 52; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":55 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_bv); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.bounce_vel = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":58 */
  __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 = 58; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":61 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_erp); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.soft_erp = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":64 */
  __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 = 64; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":67 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_cfm); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.soft_cfm = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":70 */
  __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 = 70; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":73 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_m); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.motion1 = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":76 */
  __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 = 76; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":79 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_m); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.motion2 = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":82 */
  __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 = 82; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":85 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_s); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 85; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.slip1 = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":88 */
  __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 = 88; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/contact.pyx":91 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_s); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.surface.slip2 = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_getContactGeomParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_7Contact_getContactGeomParams[] = "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(__pyx_v_pos);
  __pyx_v_normal = Py_None; Py_INCREF(__pyx_v_normal);
  __pyx_v_depth = Py_None; Py_INCREF(__pyx_v_depth);
  __pyx_v_g1 = Py_None; Py_INCREF(__pyx_v_g1);
  __pyx_v_g2 = Py_None; Py_INCREF(__pyx_v_g2);

  /* "/home/jiba/src/soya/ode/contact.pyx":102 */
  __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 = 102; 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 = 102; 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 = 102; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; 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/jiba/src/soya/ode/contact.pyx":103 */
  __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 = 103; 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 = 103; 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 = 103; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; 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/jiba/src/soya/ode/contact.pyx":104 */
  __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 = 104; goto __pyx_L1;}
  Py_DECREF(__pyx_v_depth);
  __pyx_v_depth = __pyx_1;
  __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/contact.pyx":106 */
  __pyx_v_id1 = ((long )((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.g1);

  /* "/home/jiba/src/soya/ode/contact.pyx":107 */
  __pyx_v_id2 = ((long )((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.g2);

  /* "/home/jiba/src/soya/ode/contact.pyx":108 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(__pyx_v_id1); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; goto __pyx_L1;}
  __pyx_4 = PyObject_GetItem(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; 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/jiba/src/soya/ode/contact.pyx":109 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(__pyx_v_id2); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; 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/jiba/src/soya/ode/contact.pyx":110 */
  __pyx_4 = PyTuple_New(5); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 110; 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(__pyx_r);
  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[] = "Set the ContactGeom structure of the contact.\n\n        pos (3-tuple):    Contact position, in global coordinates\n        normal (3-tuple): Unit length normal vector\n        depth (float):    Depth to which the two bodies inter-penetrate.\n        g1 (geom object): Geometry objects that collided\n        g2 (geom object):   \'\'        \'\'            \'\'\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;
  PyObject *__pyx_5 = 0;
  long __pyx_6;
  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/jiba/src/soya/ode/contact.pyx":125 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 125; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 125; 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 = 125; 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/jiba/src/soya/ode/contact.pyx":126 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; 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 = 126; 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/jiba/src/soya/ode/contact.pyx":127 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; 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 = 127; 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/jiba/src/soya/ode/contact.pyx":128 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 128; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 128; 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 = 128; 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/jiba/src/soya/ode/contact.pyx":129 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 129; 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/jiba/src/soya/ode/contact.pyx":130 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; 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 = 130; 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/jiba/src/soya/ode/contact.pyx":131 */
  __pyx_3 = PyFloat_AsDouble(__pyx_v_depth); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 131; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.depth = __pyx_3;

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

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

    /* "/home/jiba/src/soya/ode/contact.pyx":134 */
    ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.g1 = ((dGeomID )__pyx_v_id);
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/contact.pyx":136 */
    ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.g1 = ((dGeomID )0);
  }
  __pyx_L2:;

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

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

    /* "/home/jiba/src/soya/ode/contact.pyx":140 */
    ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.g2 = ((dGeomID )__pyx_v_id);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/contact.pyx":142 */
    ((struct __pyx_obj_3ode_Contact *)__pyx_v_self)->_contact.geom.g2 = ((dGeomID )0);
  }
  __pyx_L3:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_5);
  __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/jiba/src/soya/ode/world.pyx":17 */
  ((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid = dWorldCreate();

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.World.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  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/jiba/src/soya/ode/world.pyx":20 */
  __pyx_1 = (((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid != 0);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/world.pyx":21 */
    dWorldDestroy(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid);
    goto __pyx_L2;
  }
  __pyx_L2:;

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.World.__dealloc__");
  __pyx_L0:;
  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/jiba/src/soya/ode/world.pyx":32 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_gravity, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; 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 = 32; 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 = 32; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_gravity, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; 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 = 32; 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 = 32; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_gravity, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; 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 = 32; 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(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":41 */
  dWorldGetGravity(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_v_g);

  /* "/home/jiba/src/soya/ode/world.pyx":42 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_g[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_g[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_g[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; 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(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":55 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_erp); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; goto __pyx_L1;}
  dWorldSetERP(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":65 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetERP(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":79 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_cfm); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; goto __pyx_L1;}
  dWorldSetCFM(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":90 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetCFM(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":107 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_stepsize); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; goto __pyx_L1;}
  dWorldStep(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":124 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_stepsize); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; goto __pyx_L1;}
  dWorldQuickStep(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":139 */
  __pyx_1 = PyInt_AsLong(__pyx_v_num); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; goto __pyx_L1;}
  dWorldSetQuickStepNumIterations(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":150 */
  __pyx_1 = PyInt_FromLong(dWorldGetQuickStepNumIterations(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 150; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":164 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_vel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; goto __pyx_L1;}
  dWorldSetContactMaxCorrectingVel(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":175 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetContactMaxCorrectingVel(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":191 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_depth); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; goto __pyx_L1;}
  dWorldSetContactSurfaceLayer(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":204 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetContactSurfaceLayer(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 204; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":215 */
  __pyx_1 = PyInt_AsLong(__pyx_v_flag); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; goto __pyx_L1;}
  dWorldSetAutoDisableFlag(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":223 */
  __pyx_1 = PyInt_FromLong(dWorldGetAutoDisableFlag(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 223; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":236 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_threshold); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; goto __pyx_L1;}
  dWorldSetAutoDisableLinearThreshold(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":245 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetAutoDisableLinearThreshold(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":257 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_threshold); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; goto __pyx_L1;}
  dWorldSetAutoDisableAngularThreshold(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":266 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetAutoDisableAngularThreshold(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 266; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":277 */
  __pyx_1 = PyInt_AsLong(__pyx_v_steps); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; goto __pyx_L1;}
  dWorldSetAutoDisableSteps(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":285 */
  __pyx_1 = PyInt_FromLong(dWorldGetAutoDisableSteps(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":296 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_time); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 296; goto __pyx_L1;}
  dWorldSetAutoDisableTime(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":304 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetAutoDisableTime(((struct __pyx_obj_3ode_World *)__pyx_v_self)->wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/world.pyx":321 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_stepsize); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 321; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 321; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_impulse, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 321; 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 = 321; 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 = 321; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_impulse, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 321; 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 = 321; 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 = 321; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_impulse, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 321; 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 = 321; 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/jiba/src/soya/ode/world.pyx":322 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_force[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 322; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_force[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 322; goto __pyx_L1;}
  __pyx_7 = PyFloat_FromDouble((__pyx_v_force[2])); if (!__pyx_7) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 322; goto __pyx_L1;}
  __pyx_8 = PyTuple_New(3); if (!__pyx_8) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 322; 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(__pyx_r);
  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;
  int __pyx_1;
  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, 1, "world")) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 26; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/body.pyx":27 */
  ((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid = 0;

  /* "/home/jiba/src/soya/ode/body.pyx":28 */
  if (PyObject_Cmp(((PyObject *)__pyx_v_world), Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/body.pyx":29 */
    ((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid = dBodyCreate(__pyx_v_world->wid);
    goto __pyx_L2;
  }
  __pyx_L2:;

  __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, 1, "world")) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/body.pyx":37 */
  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/jiba/src/soya/ode/body.pyx":38 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 38; 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/jiba/src/soya/ode/body.pyx":41 */
  __pyx_1 = (((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid != 0);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/body.pyx":42 */
    dBodyDestroy(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid);
    goto __pyx_L2;
  }
  __pyx_L2:;

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Body.__dealloc__");
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_k67p;

static char (__pyx_k67[]) = "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/jiba/src/soya/ode/body.pyx":45 */
  /*try:*/ {

    /* "/home/jiba/src/soya/ode/body.pyx":46 */
    __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 = 46; 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/jiba/src/soya/ode/body.pyx":47 */
  /*except:*/ {
    __Pyx_AddTraceback("ode.__getattr__");
    __pyx_1 = __Pyx_GetExcValue(); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 47; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;

    /* "/home/jiba/src/soya/ode/body.pyx":48 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; goto __pyx_L1;}
    __pyx_2 = PyNumber_Remainder(__pyx_k67p, __pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; 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 = 48; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":51 */
  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 = 51; 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_k68p;

static char (__pyx_k68[]) = "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/jiba/src/soya/ode/body.pyx":54 */
  /*try:*/ {

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

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

    /* "/home/jiba/src/soya/ode/body.pyx":57 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; goto __pyx_L1;}
    __pyx_2 = PyNumber_Remainder(__pyx_k68p, __pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; 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 = 57; 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/jiba/src/soya/ode/body.pyx":68 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; 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 = 68; 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 = 68; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; 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 = 68; 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 = 68; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; 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 = 68; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":78 */
  __pyx_v_p = ((dReal (*))dBodyGetPosition(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid));

  /* "/home/jiba/src/soya/ode/body.pyx":79 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":93 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; 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 = 93; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[0]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/body.pyx":94 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 94; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 94; 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 = 94; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[1]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/body.pyx":95 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 95; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 95; 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 = 95; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[2]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/body.pyx":96 */
  (__pyx_v_m[3]) = 0;

  /* "/home/jiba/src/soya/ode/body.pyx":97 */
  __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; 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 = 97; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[4]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/body.pyx":98 */
  __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 98; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 98; 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 = 98; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[5]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/body.pyx":99 */
  __pyx_1 = PyInt_FromLong(5); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 99; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 99; 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 = 99; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[6]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/body.pyx":100 */
  (__pyx_v_m[7]) = 0;

  /* "/home/jiba/src/soya/ode/body.pyx":101 */
  __pyx_1 = PyInt_FromLong(6); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 101; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 101; 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 = 101; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[8]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/body.pyx":102 */
  __pyx_1 = PyInt_FromLong(7); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 102; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 102; 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 = 102; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[9]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/body.pyx":103 */
  __pyx_1 = PyInt_FromLong(8); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; 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 = 103; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[10]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/body.pyx":104 */
  (__pyx_v_m[11]) = 0;

  /* "/home/jiba/src/soya/ode/body.pyx":105 */
  dBodySetRotation(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_v_m);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":116 */
  __pyx_v_m = ((dReal (*))dBodyGetRotation(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid));

  /* "/home/jiba/src/soya/ode/body.pyx":117 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_m[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_m[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_m[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_m[4])); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble((__pyx_v_m[5])); if (!__pyx_5) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_m[6])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_7 = PyFloat_FromDouble((__pyx_v_m[8])); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_8 = PyFloat_FromDouble((__pyx_v_m[9])); if (!__pyx_8) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_9 = PyFloat_FromDouble((__pyx_v_m[10])); if (!__pyx_9) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_10 = PyTuple_New(9); if (!__pyx_10) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":127 */
  __pyx_v_q = ((dReal (*))dBodyGetQuaternion(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid));

  /* "/home/jiba/src/soya/ode/body.pyx":128 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_q[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 128; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_q[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 128; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_q[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 128; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_q[3])); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 128; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(4); if (!__pyx_5) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 128; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":141 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 141; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_q, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 141; 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 = 141; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_w[0]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/body.pyx":142 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 142; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_q, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 142; 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 = 142; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_w[1]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/body.pyx":143 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_q, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; 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 = 143; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_w[2]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/body.pyx":144 */
  __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_q, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; 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 = 144; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_w[3]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/body.pyx":145 */
  dBodySetQuaternion(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_v_w);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":156 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; 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 = 156; 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 = 156; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; 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 = 156; 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 = 156; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; 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 = 156; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":166 */
  __pyx_v_p = ((dReal (*))dBodyGetLinearVel(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid));

  /* "/home/jiba/src/soya/ode/body.pyx":167 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 167; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 167; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 167; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 167; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":178 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; 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 = 178; 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 = 178; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; 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 = 178; 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 = 178; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; 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 = 178; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":188 */
  __pyx_v_p = ((dReal (*))dBodyGetAngularVel(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid));

  /* "/home/jiba/src/soya/ode/body.pyx":189 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; 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(__pyx_r);
  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 = 192; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/body.pyx":201 */
  dBodySetMass(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,(&__pyx_v_mass->_mass));

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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;
  PyObject *__pyx_2 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);
  ((PyObject*)__pyx_v_m) = Py_None; Py_INCREF(((PyObject*)__pyx_v_m));

  /* "/home/jiba/src/soya/ode/body.pyx":210 */
  __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 210; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_3ode_Mass), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 210; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_3ode_Mass)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 210; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_m));
  ((PyObject *)__pyx_v_m) = __pyx_2;
  __pyx_2 = 0;

  /* "/home/jiba/src/soya/ode/body.pyx":211 */
  dBodyGetMass(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,(&__pyx_v_m->_mass));

  /* "/home/jiba/src/soya/ode/body.pyx":212 */
  Py_INCREF(((PyObject *)__pyx_v_m));
  __pyx_r = ((PyObject *)__pyx_v_m);
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __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/jiba/src/soya/ode/body.pyx":224 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 224; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 224; 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 = 224; 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 = 224; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 224; 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 = 224; 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 = 224; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 224; 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 = 224; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":235 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 235; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 235; 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 = 235; 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 = 235; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 235; 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 = 235; 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 = 235; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 235; 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 = 235; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":248 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 248; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 248; 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 = 248; 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 = 248; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 248; 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 = 248; 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 = 248; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 248; 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 = 248; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":260 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 260; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 260; 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 = 260; 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 = 260; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 260; 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 = 260; 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 = 260; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 260; 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 = 260; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":274 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 274; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 274; 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 = 274; 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 = 274; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 274; 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 = 274; 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 = 274; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 274; 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 = 274; 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 = 274; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 274; 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 = 274; 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 = 274; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 274; 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 = 274; 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 = 274; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 274; 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 = 274; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":288 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 288; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 288; 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 = 288; 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 = 288; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 288; 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 = 288; 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 = 288; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 288; 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 = 288; 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 = 288; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 288; 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 = 288; 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 = 288; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 288; 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 = 288; 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 = 288; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 288; 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 = 288; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":302 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; 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 = 302; 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 = 302; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; 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 = 302; 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 = 302; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; 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 = 302; 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 = 302; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; 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 = 302; 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 = 302; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; 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 = 302; 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 = 302; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; 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 = 302; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":316 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 316; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 316; 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 = 316; 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 = 316; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 316; 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 = 316; 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 = 316; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 316; 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 = 316; 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 = 316; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 316; 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 = 316; 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 = 316; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 316; 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 = 316; 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 = 316; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 316; 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 = 316; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":326 */
  __pyx_v_f = ((dReal (*))dBodyGetForce(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid));

  /* "/home/jiba/src/soya/ode/body.pyx":327 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_f[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 327; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_f[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 327; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_f[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 327; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 327; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":337 */
  __pyx_v_f = ((dReal (*))dBodyGetTorque(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid));

  /* "/home/jiba/src/soya/ode/body.pyx":338 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_f[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 338; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_f[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 338; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_f[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 338; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 338; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":349 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 349; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 349; 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 = 349; 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 = 349; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 349; 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 = 349; 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 = 349; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 349; 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 = 349; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":360 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 360; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 360; 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 = 360; 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 = 360; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 360; 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 = 360; 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 = 360; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 360; 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 = 360; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":375 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 375; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 375; 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 = 375; 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 = 375; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 375; 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 = 375; 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 = 375; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 375; 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 = 375; 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/jiba/src/soya/ode/body.pyx":376 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 376; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 376; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 376; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 376; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":390 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 390; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 390; 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 = 390; 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 = 390; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 390; 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 = 390; 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 = 390; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 390; 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 = 390; 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/jiba/src/soya/ode/body.pyx":391 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 391; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 391; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 391; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 391; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":405 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 405; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 405; 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 = 405; 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 = 405; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 405; 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 = 405; 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 = 405; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 405; 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 = 405; 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/jiba/src/soya/ode/body.pyx":406 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 406; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 406; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 406; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 406; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":420 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 420; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 420; 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 = 420; 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 = 420; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 420; 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 = 420; 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 = 420; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 420; 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 = 420; 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/jiba/src/soya/ode/body.pyx":421 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 421; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 421; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 421; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 421; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":434 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 434; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 434; 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 = 434; 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 = 434; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 434; 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 = 434; 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 = 434; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 434; 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 = 434; 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/jiba/src/soya/ode/body.pyx":435 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 435; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 435; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 435; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 435; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":448 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 448; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 448; 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 = 448; 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 = 448; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 448; 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 = 448; 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 = 448; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 448; 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 = 448; 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/jiba/src/soya/ode/body.pyx":449 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 449; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 449; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 449; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 449; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":458 */
  dBodyEnable(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Body.enable");
  __pyx_r = 0;
  __pyx_L0:;
  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/jiba/src/soya/ode/body.pyx":468 */
  dBodyDisable(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Body.disable");
  __pyx_r = 0;
  __pyx_L0:;
  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/jiba/src/soya/ode/body.pyx":476 */
  __pyx_1 = PyInt_FromLong(dBodyIsEnabled(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid)); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 476; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":500 */
  __pyx_1 = PyInt_AsLong(__pyx_v_mode); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 500; goto __pyx_L1;}
  dBodySetFiniteRotationMode(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":509 */
  __pyx_1 = PyInt_FromLong(dBodyGetFiniteRotationMode(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid)); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 509; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":522 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 522; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_a, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 522; 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 = 522; 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 = 522; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_a, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 522; 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 = 522; 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 = 522; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_a, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 522; 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 = 522; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":532 */
  dBodyGetFiniteRotationAxis(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_v_p);

  /* "/home/jiba/src/soya/ode/body.pyx":533 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 533; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 533; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 533; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 533; 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(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":541 */
  __pyx_1 = PyInt_FromLong(dBodyGetNumJoints(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid)); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 541; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":554 */
  __pyx_1 = PyInt_AsLong(__pyx_v_mode); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 554; goto __pyx_L1;}
  dBodySetGravityMode(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/body.pyx":562 */
  __pyx_1 = PyInt_FromLong(dBodyGetGravityMode(((struct __pyx_obj_3ode_Body *)__pyx_v_self)->bid)); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 562; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":32 */
  ((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->gid = dJointGroupCreate(0);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.JointGroup.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  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/jiba/src/soya/ode/joints.pyx":35 */
  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 35; 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 void __pyx_f_3ode_10JointGroup___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_f_3ode_10JointGroup___dealloc__(PyObject *__pyx_v_self) {
  int __pyx_1;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":38 */
  __pyx_1 = (((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->gid != 0);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/joints.pyx":39 */
    dJointGroupDestroy(((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->gid);
    goto __pyx_L2;
  }
  __pyx_L2:;

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.JointGroup.__dealloc__");
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_n__destroyed;

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;
  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_j = Py_None; Py_INCREF(__pyx_v_j);

  /* "/home/jiba/src/soya/ode/joints.pyx":47 */
  dJointGroupEmpty(((struct __pyx_obj_3ode_JointGroup *)__pyx_v_self)->gid);

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

    /* "/home/jiba/src/soya/ode/joints.pyx":49 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_j, __pyx_n__destroyed); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 49; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 49; goto __pyx_L1;}
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 49; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }
  __pyx_L3:;
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/joints.pyx":50 */
  __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 50; 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(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __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/jiba/src/soya/ode/joints.pyx":66 */
  __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 = 66; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 66; 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 = 66; 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(__pyx_r);
  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;
  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/jiba/src/soya/ode/joints.pyx":87 */
  ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid = 0;

  /* "/home/jiba/src/soya/ode/joints.pyx":88 */
  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/jiba/src/soya/ode/joints.pyx":89 */
  ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback = 0;

  /* "/home/jiba/src/soya/ode/joints.pyx":90 */
  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/jiba/src/soya/ode/joints.pyx":91 */
  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;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __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_k69p;

static char (__pyx_k69[]) = "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/jiba/src/soya/ode/joints.pyx":94 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 94; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k69p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[4]; __pyx_lineno = 94; 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/jiba/src/soya/ode/joints.pyx":97 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_setFeedback); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 97; goto __pyx_L1;}
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 97; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 97; 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 = 97; 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/jiba/src/soya/ode/joints.pyx":98 */
  __pyx_4 = (((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid != 0);
  if (__pyx_4) {

    /* "/home/jiba/src/soya/ode/joints.pyx":99 */
    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_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/jiba/src/soya/ode/joints.pyx":109 */
  ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.Joint._destroyed");
  __pyx_r = 0;
  __pyx_L0:;
  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.\n        \n        TODO: What if there\'s only one 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;
  PyObject *__pyx_r;
  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 = 112; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_body2), __pyx_ptype_3ode_Body, 1, "body2")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 112; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":125 */
  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/jiba/src/soya/ode/joints.pyx":126 */
  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/jiba/src/soya/ode/joints.pyx":127 */
  dJointAttach(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid,__pyx_v_body1->bid,__pyx_v_body2->bid);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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;
  PyObject *__pyx_4 = 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/jiba/src/soya/ode/joints.pyx":143 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 143; goto __pyx_L1;}
  if (PyObject_Cmp(__pyx_v_index, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 143; goto __pyx_L1;}
  __pyx_2 = __pyx_2 == 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/jiba/src/soya/ode/joints.pyx":144 */
    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 = 145; goto __pyx_L1;}
  if (PyObject_Cmp(__pyx_v_index, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; goto __pyx_L1;}
  __pyx_2 = __pyx_2 == 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/jiba/src/soya/ode/joints.pyx":146 */
    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/jiba/src/soya/ode/joints.pyx":148 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_IndexError); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 148; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 148; goto __pyx_L1;}
    __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 148; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 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 = 148; goto __pyx_L1;}
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __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_k70p;

static char (__pyx_k70[]) = "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/jiba/src/soya/ode/joints.pyx":163 */
  __pyx_1 = PyObject_IsTrue(__pyx_v_flag); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 163; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/joints.pyx":165 */
    __pyx_1 = (((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback != 0);
    if (__pyx_1) {

      /* "/home/jiba/src/soya/ode/joints.pyx":166 */
      __pyx_r = Py_None; Py_INCREF(__pyx_r);
      goto __pyx_L0;
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/jiba/src/soya/ode/joints.pyx":168 */
    ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback = ((dJointFeedback (*))malloc((sizeof(dJointFeedback ))));

    /* "/home/jiba/src/soya/ode/joints.pyx":169 */
    __pyx_1 = (((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback == 0);
    if (__pyx_1) {

      /* "/home/jiba/src/soya/ode/joints.pyx":170 */
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_MemoryError); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 170; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 170; goto __pyx_L1;}
      Py_INCREF(__pyx_k70p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k70p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 170; 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 = 170; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/jiba/src/soya/ode/joints.pyx":171 */
    dJointSetFeedback(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid,((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback);
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/joints.pyx":173 */
    __pyx_1 = (((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback != 0);
    if (__pyx_1) {

      /* "/home/jiba/src/soya/ode/joints.pyx":175 */
      dJointSetFeedback(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid,0);

      /* "/home/jiba/src/soya/ode/joints.pyx":176 */
      free(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback);

      /* "/home/jiba/src/soya/ode/joints.pyx":177 */
      ((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->feedback = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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(__pyx_v_f1);
  __pyx_v_t1 = Py_None; Py_INCREF(__pyx_v_t1);
  __pyx_v_f2 = Py_None; Py_INCREF(__pyx_v_f2);
  __pyx_v_t2 = Py_None; Py_INCREF(__pyx_v_t2);

  /* "/home/jiba/src/soya/ode/joints.pyx":193 */
  __pyx_v_fb = dJointGetFeedback(((struct __pyx_obj_3ode_Joint *)__pyx_v_self)->jid);

  /* "/home/jiba/src/soya/ode/joints.pyx":194 */
  __pyx_1 = (__pyx_v_fb == 0);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/joints.pyx":195 */
    Py_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/joints.pyx":197 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_fb->f1[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 197; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_fb->f1[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 197; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_fb->f1[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 197; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 197; 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/jiba/src/soya/ode/joints.pyx":198 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_fb->t1[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 198; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_fb->t1[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 198; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_fb->t1[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 198; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 198; 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/jiba/src/soya/ode/joints.pyx":199 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_fb->f2[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 199; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_fb->f2[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 199; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_fb->f2[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 199; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 199; 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/jiba/src/soya/ode/joints.pyx":200 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_fb->t2[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 200; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_fb->t2[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 200; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_fb->t2[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 200; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 200; 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/jiba/src/soya/ode/joints.pyx":201 */
  __pyx_2 = PyTuple_New(4); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 201; 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(__pyx_r);
  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);
  ((PyObject*)__pyx_v_jg) = Py_None; Py_INCREF(((PyObject*)__pyx_v_jg));
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 215; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":219 */
  __pyx_v_jgid = 0;

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

    /* "/home/jiba/src/soya/ode/joints.pyx":221 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 221; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    ((PyObject *)__pyx_v_jg) = __pyx_v_jointgroup;

    /* "/home/jiba/src/soya/ode/joints.pyx":222 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/joints.pyx":223 */
  ((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 = 225; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":226 */
  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/jiba/src/soya/ode/joints.pyx":227 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 227; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/joints.pyx":228 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 228; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 228; goto __pyx_L1;}
    Py_INCREF((PyObject *)__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 = 228; 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/jiba/src/soya/ode/joints.pyx":240 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 240; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 240; 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 = 240; 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 = 240; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 240; 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 = 240; 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 = 240; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 240; 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 = 240; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":252 */
  dJointGetBallAnchor(((struct __pyx_obj_3ode_BallJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/jiba/src/soya/ode/joints.pyx":253 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 253; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 253; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 253; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 253; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":265 */
  dJointGetBallAnchor2(((struct __pyx_obj_3ode_BallJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/jiba/src/soya/ode/joints.pyx":266 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 266; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 266; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 266; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 266; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":271 */

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.BallJoint.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_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/jiba/src/soya/ode/joints.pyx":275 */
  __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 275; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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);
  ((PyObject*)__pyx_v_jg) = Py_None; Py_INCREF(((PyObject*)__pyx_v_jg));
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 287; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":291 */
  __pyx_v_jgid = 0;

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

    /* "/home/jiba/src/soya/ode/joints.pyx":293 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 293; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    ((PyObject *)__pyx_v_jg) = __pyx_v_jointgroup;

    /* "/home/jiba/src/soya/ode/joints.pyx":294 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/joints.pyx":295 */
  ((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 = 297; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":298 */
  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/jiba/src/soya/ode/joints.pyx":299 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 299; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/joints.pyx":300 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 300; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 300; goto __pyx_L1;}
    Py_INCREF((PyObject *)__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 = 300; 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/jiba/src/soya/ode/joints.pyx":311 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 311; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 311; 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 = 311; 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 = 311; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 311; 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 = 311; 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 = 311; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 311; 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 = 311; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":322 */
  dJointGetHingeAnchor(((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/jiba/src/soya/ode/joints.pyx":323 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 323; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 323; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 323; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 323; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":334 */
  dJointGetHingeAnchor2(((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/jiba/src/soya/ode/joints.pyx":335 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 335; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 335; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 335; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 335; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":346 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 346; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 346; 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 = 346; 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 = 346; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 346; 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 = 346; 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 = 346; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 346; 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 = 346; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":355 */
  dJointGetHingeAxis(((struct __pyx_obj_3ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

  /* "/home/jiba/src/soya/ode/joints.pyx":356 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 356; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 356; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 356; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":371 */
  __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 = 371; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":379 */
  __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 = 379; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_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/jiba/src/soya/ode/joints.pyx":400 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 400; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 400; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":418 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 418; 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 = 418; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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);
  ((PyObject*)__pyx_v_jg) = Py_None; Py_INCREF(((PyObject*)__pyx_v_jg));
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 430; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":434 */
  __pyx_v_jgid = 0;

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

    /* "/home/jiba/src/soya/ode/joints.pyx":436 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 436; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    ((PyObject *)__pyx_v_jg) = __pyx_v_jointgroup;

    /* "/home/jiba/src/soya/ode/joints.pyx":437 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/joints.pyx":438 */
  ((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 = 440; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":441 */
  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/jiba/src/soya/ode/joints.pyx":442 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 442; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/joints.pyx":443 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 443; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 443; goto __pyx_L1;}
    Py_INCREF((PyObject *)__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 = 443; 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/jiba/src/soya/ode/joints.pyx":454 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; 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 = 454; 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 = 454; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; 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 = 454; 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 = 454; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; 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 = 454; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":463 */
  dJointGetSliderAxis(((struct __pyx_obj_3ode_SliderJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

  /* "/home/jiba/src/soya/ode/joints.pyx":464 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 464; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 464; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 464; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 464; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":477 */
  __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 = 477; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":485 */
  __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 = 485; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_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/jiba/src/soya/ode/joints.pyx":489 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 489; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 489; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":493 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 493; 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 = 493; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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);
  ((PyObject*)__pyx_v_jg) = Py_None; Py_INCREF(((PyObject*)__pyx_v_jg));
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 505; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":509 */
  __pyx_v_jgid = 0;

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

    /* "/home/jiba/src/soya/ode/joints.pyx":511 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 511; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    ((PyObject *)__pyx_v_jg) = __pyx_v_jointgroup;

    /* "/home/jiba/src/soya/ode/joints.pyx":512 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/joints.pyx":513 */
  ((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 = 515; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":516 */
  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/jiba/src/soya/ode/joints.pyx":517 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 517; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/joints.pyx":518 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 518; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 518; goto __pyx_L1;}
    Py_INCREF((PyObject *)__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 = 518; 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/jiba/src/soya/ode/joints.pyx":529 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 529; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 529; 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 = 529; 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 = 529; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 529; 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 = 529; 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 = 529; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 529; 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 = 529; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":541 */
  dJointGetUniversalAnchor(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/jiba/src/soya/ode/joints.pyx":542 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 542; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 542; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 542; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 542; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":554 */
  dJointGetUniversalAnchor2(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/jiba/src/soya/ode/joints.pyx":555 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 555; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 555; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 555; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 555; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":567 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 567; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 567; 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 = 567; 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 = 567; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 567; 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 = 567; 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 = 567; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 567; 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 = 567; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":576 */
  dJointGetUniversalAxis1(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

  /* "/home/jiba/src/soya/ode/joints.pyx":577 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 577; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 577; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 577; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 577; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":589 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 589; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 589; 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 = 589; 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 = 589; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 589; 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 = 589; 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 = 589; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 589; 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 = 589; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":598 */
  dJointGetUniversalAxis2(((struct __pyx_obj_3ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

  /* "/home/jiba/src/soya/ode/joints.pyx":599 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 599; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 599; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 599; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 599; 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(__pyx_r);
  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_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/jiba/src/soya/ode/joints.pyx":603 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 603; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 603; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":607 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 607; 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 = 607; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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);
  ((PyObject*)__pyx_v_jg) = Py_None; Py_INCREF(((PyObject*)__pyx_v_jg));
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 619; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":623 */
  __pyx_v_jgid = 0;

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

    /* "/home/jiba/src/soya/ode/joints.pyx":625 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 625; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    ((PyObject *)__pyx_v_jg) = __pyx_v_jointgroup;

    /* "/home/jiba/src/soya/ode/joints.pyx":626 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/joints.pyx":627 */
  ((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 = 629; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":630 */
  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/jiba/src/soya/ode/joints.pyx":631 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 631; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/joints.pyx":632 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 632; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 632; goto __pyx_L1;}
    Py_INCREF((PyObject *)__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 = 632; 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/jiba/src/soya/ode/joints.pyx":643 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 643; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 643; 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 = 643; 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 = 643; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 643; 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 = 643; 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 = 643; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 643; 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 = 643; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":655 */
  dJointGetHinge2Anchor(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/jiba/src/soya/ode/joints.pyx":656 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 656; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 656; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 656; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 656; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":668 */
  dJointGetHinge2Anchor2(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

  /* "/home/jiba/src/soya/ode/joints.pyx":669 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 669; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 669; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 669; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 669; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":682 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 682; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 682; 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 = 682; 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 = 682; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 682; 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 = 682; 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 = 682; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 682; 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 = 682; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":691 */
  dJointGetHinge2Axis1(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

  /* "/home/jiba/src/soya/ode/joints.pyx":692 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 692; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 692; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 692; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 692; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":704 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 704; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 704; 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 = 704; 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 = 704; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 704; 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 = 704; 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 = 704; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 704; 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 = 704; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":713 */
  dJointGetHinge2Axis2(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

  /* "/home/jiba/src/soya/ode/joints.pyx":714 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 714; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 714; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 714; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 714; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":726 */
  __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 = 726; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":734 */
  __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 = 734; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":742 */
  __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 = 742; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_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/jiba/src/soya/ode/joints.pyx":746 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 746; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 746; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":750 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 750; 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 = 750; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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);
  ((PyObject*)__pyx_v_jg) = Py_None; Py_INCREF(((PyObject*)__pyx_v_jg));
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 762; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":766 */
  __pyx_v_jgid = 0;

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

    /* "/home/jiba/src/soya/ode/joints.pyx":768 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    ((PyObject *)__pyx_v_jg) = __pyx_v_jointgroup;

    /* "/home/jiba/src/soya/ode/joints.pyx":769 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/joints.pyx":770 */
  ((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 = 772; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":773 */
  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/jiba/src/soya/ode/joints.pyx":774 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 774; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/joints.pyx":775 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 775; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 775; goto __pyx_L1;}
    Py_INCREF((PyObject *)__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 = 775; 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/jiba/src/soya/ode/joints.pyx":785 */
  dJointSetFixed(((struct __pyx_obj_3ode_FixedJoint *)__pyx_v_self)->__pyx_base.jid);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.FixedJoint.setFixed");
  __pyx_r = 0;
  __pyx_L0:;
  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);
  ((PyObject*)__pyx_v_jg) = Py_None; Py_INCREF(((PyObject*)__pyx_v_jg));
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 797; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_contact), __pyx_ptype_3ode_Contact, 1, "contact")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 797; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":800 */
  __pyx_v_jgid = 0;

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

    /* "/home/jiba/src/soya/ode/joints.pyx":802 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 802; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    ((PyObject *)__pyx_v_jg) = __pyx_v_jointgroup;

    /* "/home/jiba/src/soya/ode/joints.pyx":803 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/joints.pyx":804 */
  ((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 = 806; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_contact), __pyx_ptype_3ode_Contact, 1, "contact")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":807 */
  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/jiba/src/soya/ode/joints.pyx":808 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 808; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/joints.pyx":809 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 809; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 809; goto __pyx_L1;}
    Py_INCREF((PyObject *)__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 = 809; 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);
  ((PyObject*)__pyx_v_jg) = Py_None; Py_INCREF(((PyObject*)__pyx_v_jg));
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_3ode_World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 820; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":824 */
  __pyx_v_jgid = 0;

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

    /* "/home/jiba/src/soya/ode/joints.pyx":826 */
    if (!__Pyx_TypeTest(__pyx_v_jointgroup, __pyx_ptype_3ode_JointGroup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 826; goto __pyx_L1;}
    Py_INCREF(__pyx_v_jointgroup);
    Py_DECREF(((PyObject *)__pyx_v_jg));
    ((PyObject *)__pyx_v_jg) = __pyx_v_jointgroup;

    /* "/home/jiba/src/soya/ode/joints.pyx":827 */
    __pyx_v_jgid = __pyx_v_jg->gid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/joints.pyx":828 */
  ((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 = 830; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":831 */
  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/jiba/src/soya/ode/joints.pyx":832 */
  if (PyObject_Cmp(__pyx_v_jointgroup, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 832; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/joints.pyx":833 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 833; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 833; goto __pyx_L1;}
    Py_INCREF((PyObject *)__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 = 833; 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/jiba/src/soya/ode/joints.pyx":845 */
  __pyx_1 = PyInt_AsLong(__pyx_v_mode); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 845; goto __pyx_L1;}
  dJointSetAMotorMode(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":853 */
  __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 = 853; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":865 */
  dJointSetAMotorNumAxes(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_num);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.AMotor.setNumAxes");
  __pyx_r = 0;
  __pyx_L0:;
  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/jiba/src/soya/ode/joints.pyx":873 */
  __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 = 873; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":899 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 899; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 899; 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 = 899; 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 = 899; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 899; 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 = 899; 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 = 899; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 899; 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 = 899; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":911 */
  dJointGetAMotorAxis(((struct __pyx_obj_3ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_anum,__pyx_v_a);

  /* "/home/jiba/src/soya/ode/joints.pyx":912 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 912; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 912; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 912; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 912; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":923 */
  __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 = 923; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":936 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_angle); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 936; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":947 */
  __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 = 947; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":958 */
  __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 = 958; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_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/jiba/src/soya/ode/joints.pyx":962 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 962; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 962; 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(__pyx_r);
  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/jiba/src/soya/ode/joints.pyx":966 */
  __pyx_1 = PyInt_AsLong(__pyx_v_param); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 966; 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 = 966; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_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/jiba/src/soya/ode/geomobject.pyx":35 */
  ((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid = 0;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":36 */
  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/jiba/src/soya/ode/geomobject.pyx":37 */
  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/jiba/src/soya/ode/geomobject.pyx":38 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; 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_k71p;

static char (__pyx_k71[]) = "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/jiba/src/soya/ode/geomobject.pyx":41 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 41; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k71p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[5]; __pyx_lineno = 41; 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/jiba/src/soya/ode/geomobject.pyx":44 */
  __pyx_1 = (((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid != 0);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":45 */
    dGeomDestroy(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid);

    /* "/home/jiba/src/soya/ode/geomobject.pyx":46 */
    ((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomObject.__dealloc__");
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_k72p;

static char (__pyx_k72[]) = "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/jiba/src/soya/ode/geomobject.pyx":49 */
  __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 = 49; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":50 */
    __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 = 50; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":52 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 52; goto __pyx_L1;}
    __pyx_3 = PyNumber_Remainder(__pyx_k72p, __pyx_v_name); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 52; 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 = 52; goto __pyx_L1;}
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geomobject.pyx":55 */
  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 = 55; 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_k73p;

static char (__pyx_k73[]) = "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/jiba/src/soya/ode/geomobject.pyx":65 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k73p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; goto __pyx_L1;}

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geomobject.pyx":74 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 74; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_k74p;

static char (__pyx_k74[]) = "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;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  int __pyx_5;
  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 = 76; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/geomobject.pyx":85 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 85; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 85; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 85; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyObject_IsTrue(__pyx_3); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 85; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = (!__pyx_4);
  if (__pyx_5) {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":86 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 86; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k74p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 86; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":88 */
  if (PyObject_Cmp(((PyObject *)__pyx_v_body), Py_None, &__pyx_4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; goto __pyx_L1;}
  __pyx_4 = __pyx_4 == 0;
  if (__pyx_4) {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":89 */
    dGeomSetBody(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,0);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":91 */
    dGeomSetBody(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,__pyx_v_body->bid);
  }
  __pyx_L3:;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":92 */
  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(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __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;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  int __pyx_5;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":99 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 99; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 99; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 99; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyObject_IsTrue(__pyx_3); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 99; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = (!__pyx_4);
  if (__pyx_5) {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":100 */
    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_environment); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 100; goto __pyx_L1;}
    __pyx_r = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":102 */
  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(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.GeomObject.getBody");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_k75p;

static char (__pyx_k75[]) = "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;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  int __pyx_5;
  dReal __pyx_6;
  dReal __pyx_7;
  dReal __pyx_8;
  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/jiba/src/soya/ode/geomobject.pyx":113 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 113; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 113; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 113; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyObject_IsTrue(__pyx_3); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 113; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = (!__pyx_4);
  if (__pyx_5) {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":114 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 114; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k75p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 114; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":115 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 115; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_pos, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 115; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 115; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 115; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 115; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_7 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 115; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_3 = PyInt_FromLong(2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 115; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_pos, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 115; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_8 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 115; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  dGeomSetPosition(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,__pyx_6,__pyx_7,__pyx_8);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __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_k76p;

static char (__pyx_k76[]) = "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;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  int __pyx_5;
  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/jiba/src/soya/ode/geomobject.pyx":123 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyObject_IsTrue(__pyx_3); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = (!__pyx_4);
  if (__pyx_5) {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":124 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 124; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k76p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 124; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":127 */
  __pyx_v_p = ((dReal (*))dGeomGetPosition(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid));

  /* "/home/jiba/src/soya/ode/geomobject.pyx":128 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_p[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 128; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_p[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 128; goto __pyx_L1;}
  __pyx_1 = PyFloat_FromDouble((__pyx_v_p[2])); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 128; goto __pyx_L1;}
  __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 128; 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_1);
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_1 = 0;
  __pyx_r = __pyx_6;
  __pyx_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  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_k77p;

static char (__pyx_k77[]) = "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;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  int __pyx_5;
  dReal __pyx_6;
  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/jiba/src/soya/ode/geomobject.pyx":139 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 139; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 139; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 139; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyObject_IsTrue(__pyx_3); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 139; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = (!__pyx_4);
  if (__pyx_5) {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":140 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 140; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k77p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 140; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":143 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 143; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_R, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 143; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 143; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_m[0]) = __pyx_6;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":144 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 144; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 144; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 144; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[1]) = __pyx_6;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":145 */
  __pyx_3 = PyInt_FromLong(2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 145; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_R, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 145; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 145; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_m[2]) = __pyx_6;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":146 */
  (__pyx_v_m[3]) = 0;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":147 */
  __pyx_2 = PyInt_FromLong(3); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 147; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_R, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_m[4]) = __pyx_6;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":148 */
  __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 148; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 148; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 148; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[5]) = __pyx_6;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":149 */
  __pyx_3 = PyInt_FromLong(5); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_R, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_m[6]) = __pyx_6;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":150 */
  (__pyx_v_m[7]) = 0;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":151 */
  __pyx_2 = PyInt_FromLong(6); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_R, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_m[8]) = __pyx_6;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":152 */
  __pyx_1 = PyInt_FromLong(7); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_R, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_m[9]) = __pyx_6;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":153 */
  __pyx_3 = PyInt_FromLong(8); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 153; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_R, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 153; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_6 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 153; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_m[10]) = __pyx_6;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":154 */
  (__pyx_v_m[11]) = 0;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":155 */
  dGeomSetRotation(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,__pyx_v_m);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __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_k78p;

static char (__pyx_k78[]) = "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;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  int __pyx_5;
  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/jiba/src/soya/ode/geomobject.pyx":163 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 163; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 163; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 163; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyObject_IsTrue(__pyx_3); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 163; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = (!__pyx_4);
  if (__pyx_5) {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":164 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 164; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k78p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 164; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":167 */
  __pyx_v_m = ((dReal (*))dGeomGetRotation(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid));

  /* "/home/jiba/src/soya/ode/geomobject.pyx":168 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_m[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_m[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; goto __pyx_L1;}
  __pyx_1 = PyFloat_FromDouble((__pyx_v_m[2])); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_m[4])); if (!__pyx_6) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; goto __pyx_L1;}
  __pyx_7 = PyFloat_FromDouble((__pyx_v_m[5])); if (!__pyx_7) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; goto __pyx_L1;}
  __pyx_8 = PyFloat_FromDouble((__pyx_v_m[6])); if (!__pyx_8) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; goto __pyx_L1;}
  __pyx_9 = PyFloat_FromDouble((__pyx_v_m[8])); if (!__pyx_9) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; goto __pyx_L1;}
  __pyx_10 = PyFloat_FromDouble((__pyx_v_m[9])); if (!__pyx_10) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; goto __pyx_L1;}
  __pyx_11 = PyFloat_FromDouble((__pyx_v_m[10])); if (!__pyx_11) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; goto __pyx_L1;}
  __pyx_12 = PyList_New(9); if (!__pyx_12) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; goto __pyx_L1;}
  PyList_SET_ITEM(__pyx_12, 0, __pyx_2);
  PyList_SET_ITEM(__pyx_12, 1, __pyx_3);
  PyList_SET_ITEM(__pyx_12, 2, __pyx_1);
  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_3 = 0;
  __pyx_1 = 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(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  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_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/jiba/src/soya/ode/geomobject.pyx":178 */
  dGeomGetAABB(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,__pyx_v_aabb);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":179 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_aabb[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_aabb[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_aabb[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_aabb[3])); if (!__pyx_4) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble((__pyx_v_aabb[4])); if (!__pyx_5) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_aabb[5])); if (!__pyx_6) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(6); if (!__pyx_7) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; 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(__pyx_r);
  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/jiba/src/soya/ode/geomobject.pyx":185 */
  __pyx_1 = PyInt_FromLong(dGeomIsSpace(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 185; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geomobject.pyx":192 */
  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(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomObject.getSpace");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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\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;
  unsigned long __pyx_1;
  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/jiba/src/soya/ode/geomobject.pyx":202 */
  __pyx_1 = PyLong_AsUnsignedLong(__pyx_v_bits); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 202; goto __pyx_L1;}
  dGeomSetCollideBits(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __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\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;
  unsigned long __pyx_1;
  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/jiba/src/soya/ode/geomobject.pyx":212 */
  __pyx_1 = PyLong_AsUnsignedLong(__pyx_v_bits); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 212; goto __pyx_L1;}
  dGeomSetCategoryBits(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __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() -> int\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/jiba/src/soya/ode/geomobject.pyx":219 */
  __pyx_1 = PyLong_FromUnsignedLong(dGeomGetCollideBits(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 219; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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() -> int\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/jiba/src/soya/ode/geomobject.pyx":226 */
  __pyx_1 = PyLong_FromUnsignedLong(dGeomGetCategoryBits(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 226; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geomobject.pyx":232 */
  dGeomEnable(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomObject.enable");
  __pyx_r = 0;
  __pyx_L0:;
  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/jiba/src/soya/ode/geomobject.pyx":238 */
  dGeomDisable(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomObject.disable");
  __pyx_r = 0;
  __pyx_L0:;
  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/jiba/src/soya/ode/geomobject.pyx":244 */
  __pyx_1 = PyInt_FromLong(dGeomIsEnabled(((struct __pyx_obj_3ode_GeomObject *)__pyx_v_self)->gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 244; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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/jiba/src/soya/ode/space.pyx":28 */

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.SpaceBase.__new__");
  __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 PyObject *__pyx_k79p;

static char (__pyx_k79[]) = "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/jiba/src/soya/ode/space.pyx":31 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 31; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k79p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[6]; __pyx_lineno = 31; 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/jiba/src/soya/ode/space.pyx":34 */
  __pyx_1 = (((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->__pyx_base.gid != 0);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/space.pyx":35 */
    dSpaceDestroy(((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid);

    /* "/home/jiba/src/soya/ode/space.pyx":36 */
    ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid = 0;

    /* "/home/jiba/src/soya/ode/space.pyx":37 */
    ((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->__pyx_base.gid = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.SpaceBase.__dealloc__");
  __pyx_L0:;
  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/jiba/src/soya/ode/space.pyx":60 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid);

  /* "/home/jiba/src/soya/ode/space.pyx":61 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 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 = 63; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/space.pyx":73 */
  dSpaceAdd(((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid,__pyx_v_geom->gid);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 = 75; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/space.pyx":83 */
  dSpaceRemove(((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid,__pyx_v_geom->gid);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 = 85; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/space.pyx":93 */
  __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 = 93; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/space.pyx":100 */
  __pyx_1 = PyInt_FromLong(dSpaceGetNumGeoms(((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid)); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 100; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_k80p;
static PyObject *__pyx_k81p;

static char (__pyx_k80[]) = "geom index out of range";
static char (__pyx_k81[]) = "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/jiba/src/soya/ode/space.pyx":113 */
  __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/jiba/src/soya/ode/space.pyx":114 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_IndexError); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 114; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k80p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[6]; __pyx_lineno = 114; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/space.pyx":116 */
  __pyx_v_gid = dSpaceGetGeom(((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid,__pyx_v_idx);

  /* "/home/jiba/src/soya/ode/space.pyx":117 */
  __pyx_2 = PyInt_FromLong(((long )__pyx_v_gid)); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_1 = PySequence_Contains(__pyx_3, __pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 117; 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/jiba/src/soya/ode/space.pyx":118 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k81p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/jiba/src/soya/ode/space.pyx":120 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 120; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(((long )__pyx_v_gid)); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 120; goto __pyx_L1;}
  __pyx_4 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 120; 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(__pyx_r);
  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[] = "Do collision detection.\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        ";
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(__pyx_v_tup);

  /* "/home/jiba/src/soya/ode/space.pyx":141 */
  __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 141; 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/jiba/src/soya/ode/space.pyx":142 */
  __pyx_v_data = ((void (*))__pyx_v_tup);

  /* "/home/jiba/src/soya/ode/space.pyx":143 */
  dSpaceCollide(((struct __pyx_obj_3ode_SpaceBase *)__pyx_v_self)->sid,__pyx_v_data,__pyx_f_3ode_collide_callback);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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(__pyx_v_tup);
  __pyx_v_callback = Py_None; Py_INCREF(__pyx_v_callback);
  __pyx_v_arg = Py_None; Py_INCREF(__pyx_v_arg);
  __pyx_v_g1 = Py_None; Py_INCREF(__pyx_v_g1);
  __pyx_v_g2 = Py_None; Py_INCREF(__pyx_v_g2);

  /* "/home/jiba/src/soya/ode/space.pyx":159 */
  __pyx_1 = (PyObject *)__pyx_v_data;
  Py_INCREF(__pyx_1);
  Py_DECREF(__pyx_v_tup);
  __pyx_v_tup = __pyx_1;
  __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/space.pyx":160 */
  __pyx_1 = __Pyx_UnpackItem(__pyx_v_tup, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 160; goto __pyx_L1;}
  Py_DECREF(__pyx_v_callback);
  __pyx_v_callback = __pyx_1;
  __pyx_1 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_v_tup, 1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 160; goto __pyx_L1;}
  Py_DECREF(__pyx_v_arg);
  __pyx_v_arg = __pyx_2;
  __pyx_2 = 0;
  if (__Pyx_EndUnpack(__pyx_v_tup, 2) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 160; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/space.pyx":161 */
  __pyx_v_id1 = ((long )__pyx_v_o1);

  /* "/home/jiba/src/soya/ode/space.pyx":162 */
  __pyx_v_id2 = ((long )__pyx_v_o2);

  /* "/home/jiba/src/soya/ode/space.pyx":163 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 163; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(__pyx_v_id1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 163; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 163; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_g1);
  __pyx_v_g1 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/jiba/src/soya/ode/space.pyx":164 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 164; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(__pyx_v_id2); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 164; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 164; 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/jiba/src/soya/ode/space.pyx":165 */
  __pyx_1 = PyTuple_New(3); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 165; goto __pyx_L1;}
  Py_INCREF(__pyx_v_arg);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_arg);
  Py_INCREF(__pyx_v_g1);
  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_g1);
  Py_INCREF(__pyx_v_g2);
  PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_g2);
  __pyx_2 = PyObject_CallObject(__pyx_v_callback, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 165; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 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_k19;
  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);
  ((PyObject*)__pyx_v_sp) = Py_None; Py_INCREF(((PyObject*)__pyx_v_sp));

  /* "/home/jiba/src/soya/ode/space.pyx":185 */
  __pyx_v_parentid = 0;

  /* "/home/jiba/src/soya/ode/space.pyx":186 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 186; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/space.pyx":187 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 187; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF((PyObject *)((PyObject *)__pyx_v_sp));
    ((PyObject *)__pyx_v_sp) = __pyx_v_space;

    /* "/home/jiba/src/soya/ode/space.pyx":188 */
    __pyx_v_parentid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/space.pyx":190 */
  ((struct __pyx_obj_3ode_SimpleSpace *)__pyx_v_self)->__pyx_base.sid = dSimpleSpaceCreate(__pyx_v_parentid);

  /* "/home/jiba/src/soya/ode/space.pyx":193 */
  ((struct __pyx_obj_3ode_SimpleSpace *)__pyx_v_self)->__pyx_base.__pyx_base.gid = ((dGeomID )((struct __pyx_obj_3ode_SimpleSpace *)__pyx_v_self)->__pyx_base.sid);

  /* "/home/jiba/src/soya/ode/space.pyx":195 */
  dSpaceSetCleanup(((struct __pyx_obj_3ode_SimpleSpace *)__pyx_v_self)->__pyx_base.sid,0);

  /* "/home/jiba/src/soya/ode/space.pyx":196 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 196; 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 = 196; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_2, __pyx_3, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 196; 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_k20;
  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/jiba/src/soya/ode/space.pyx":199 */

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.SimpleSpace.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  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_k21;
  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);
  ((PyObject*)__pyx_v_sp) = Py_None; Py_INCREF(((PyObject*)__pyx_v_sp));

  /* "/home/jiba/src/soya/ode/space.pyx":218 */
  __pyx_v_parentid = 0;

  /* "/home/jiba/src/soya/ode/space.pyx":219 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 219; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/space.pyx":220 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 220; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF((PyObject *)((PyObject *)__pyx_v_sp));
    ((PyObject *)__pyx_v_sp) = __pyx_v_space;

    /* "/home/jiba/src/soya/ode/space.pyx":221 */
    __pyx_v_parentid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/space.pyx":223 */
  ((struct __pyx_obj_3ode_HashSpace *)__pyx_v_self)->__pyx_base.sid = dHashSpaceCreate(__pyx_v_parentid);

  /* "/home/jiba/src/soya/ode/space.pyx":226 */
  ((struct __pyx_obj_3ode_HashSpace *)__pyx_v_self)->__pyx_base.__pyx_base.gid = ((dGeomID )((struct __pyx_obj_3ode_HashSpace *)__pyx_v_self)->__pyx_base.sid);

  /* "/home/jiba/src/soya/ode/space.pyx":228 */
  dSpaceSetCleanup(((struct __pyx_obj_3ode_HashSpace *)__pyx_v_self)->__pyx_base.sid,0);

  /* "/home/jiba/src/soya/ode/space.pyx":229 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 229; 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 = 229; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_2, __pyx_3, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 229; 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_k22;
  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/jiba/src/soya/ode/space.pyx":232 */

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.HashSpace.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_space);
  return __pyx_r;
}

static PyObject *__pyx_k82p;

static char (__pyx_k82[]) = "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/jiba/src/soya/ode/space.pyx":242 */
  __pyx_1 = (__pyx_v_minlevel > __pyx_v_maxlevel);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/space.pyx":243 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 243; goto __pyx_L1;}
    __pyx_3 = PyInt_FromLong(__pyx_v_minlevel); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 243; goto __pyx_L1;}
    __pyx_4 = PyInt_FromLong(__pyx_v_maxlevel); if (!__pyx_4) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 243; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 243; 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_k82p, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 243; 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 = 243; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/space.pyx":245 */
  dHashSpaceSetLevels(((struct __pyx_obj_3ode_HashSpace *)__pyx_v_self)->__pyx_base.sid,__pyx_v_minlevel,__pyx_v_maxlevel);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/space.pyx":257 */
  dHashSpaceGetLevels(((struct __pyx_obj_3ode_HashSpace *)__pyx_v_self)->__pyx_base.sid,(&__pyx_v_minlevel),(&__pyx_v_maxlevel));

  /* "/home/jiba/src/soya/ode/space.pyx":258 */
  __pyx_1 = PyInt_FromLong(__pyx_v_minlevel); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 258; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(__pyx_v_maxlevel); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 258; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __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(__pyx_r);
  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_k23;
  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);
  ((PyObject*)__pyx_v_sp) = Py_None; Py_INCREF(((PyObject*)__pyx_v_sp));

  /* "/home/jiba/src/soya/ode/space.pyx":279 */
  __pyx_v_parentid = 0;

  /* "/home/jiba/src/soya/ode/space.pyx":280 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 280; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/space.pyx":281 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 281; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF((PyObject *)((PyObject *)__pyx_v_sp));
    ((PyObject *)__pyx_v_sp) = __pyx_v_space;

    /* "/home/jiba/src/soya/ode/space.pyx":282 */
    __pyx_v_parentid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/space.pyx":284 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 284; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_center, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 284; 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 = 284; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_c[0]) = __pyx_4;

  /* "/home/jiba/src/soya/ode/space.pyx":285 */
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 285; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_center, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 285; 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 = 285; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_c[1]) = __pyx_4;

  /* "/home/jiba/src/soya/ode/space.pyx":286 */
  __pyx_2 = PyInt_FromLong(2); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 286; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_center, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 286; 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 = 286; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_c[2]) = __pyx_4;

  /* "/home/jiba/src/soya/ode/space.pyx":287 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 287; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_extents, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 287; 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 = 287; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_e[0]) = __pyx_4;

  /* "/home/jiba/src/soya/ode/space.pyx":288 */
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 288; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_extents, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 288; 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 = 288; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_e[1]) = __pyx_4;

  /* "/home/jiba/src/soya/ode/space.pyx":289 */
  __pyx_2 = PyInt_FromLong(2); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 289; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_extents, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 289; 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 = 289; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  (__pyx_v_e[2]) = __pyx_4;

  /* "/home/jiba/src/soya/ode/space.pyx":290 */
  __pyx_1 = PyInt_AsLong(__pyx_v_depth); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 290; 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/jiba/src/soya/ode/space.pyx":293 */
  ((struct __pyx_obj_3ode_QuadTreeSpace *)__pyx_v_self)->__pyx_base.__pyx_base.gid = ((dGeomID )((struct __pyx_obj_3ode_QuadTreeSpace *)__pyx_v_self)->__pyx_base.sid);

  /* "/home/jiba/src/soya/ode/space.pyx":295 */
  dSpaceSetCleanup(((struct __pyx_obj_3ode_QuadTreeSpace *)__pyx_v_self)->__pyx_base.sid,0);

  /* "/home/jiba/src/soya/ode/space.pyx":296 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 296; 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 = 296; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_2, __pyx_3, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 296; 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_k24;
  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/jiba/src/soya/ode/space.pyx":299 */

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.QuadTreeSpace.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  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_k83p;

static char (__pyx_k83[]) = "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_k25;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_type)) return 0;
  Py_INCREF(__pyx_v_type);

  /* "/home/jiba/src/soya/ode/space.pyx":314 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 314; goto __pyx_L1;}
  if (PyObject_Cmp(__pyx_v_type, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 314; goto __pyx_L1;}
  __pyx_2 = __pyx_2 == 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/jiba/src/soya/ode/space.pyx":315 */
    __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 315; goto __pyx_L1;}
    __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_3ode_SimpleSpace), __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 315; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_r = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 316; goto __pyx_L1;}
  if (PyObject_Cmp(__pyx_v_type, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 316; goto __pyx_L1;}
  __pyx_2 = __pyx_2 == 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/jiba/src/soya/ode/space.pyx":317 */
    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 317; goto __pyx_L1;}
    __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_3ode_HashSpace), __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 317; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_r = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/space.pyx":319 */
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 319; goto __pyx_L1;}
    __pyx_1 = PyNumber_Remainder(__pyx_k83p, __pyx_v_type); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 319; goto __pyx_L1;}
    __Pyx_Raise(__pyx_3, __pyx_1, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[6]; __pyx_lineno = 319; goto __pyx_L1;}
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_k26;
  __pyx_v_radius = __pyx_k27;
  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);
  ((PyObject*)__pyx_v_sp) = Py_None; Py_INCREF(((PyObject*)__pyx_v_sp));

  /* "/home/jiba/src/soya/ode/geoms.pyx":18 */
  __pyx_v_sid = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":19 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 19; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":20 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 20; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF((PyObject *)((PyObject *)__pyx_v_sp));
    ((PyObject *)__pyx_v_sp) = __pyx_v_space;

    /* "/home/jiba/src/soya/ode/geoms.pyx":21 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geoms.pyx":22 */
  __pyx_2 = PyFloat_AsDouble(__pyx_v_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 22; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_GeomSphere *)__pyx_v_self)->__pyx_base.gid = dCreateSphere(__pyx_v_sid,__pyx_2);

  /* "/home/jiba/src/soya/ode/geoms.pyx":26 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 26; 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 = 26; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_3, __pyx_4, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 26; 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_k28;
  __pyx_v_radius = __pyx_k29;
  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/jiba/src/soya/ode/geoms.pyx":30 */
  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/jiba/src/soya/ode/geoms.pyx":31 */
  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;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomSphere.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  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/jiba/src/soya/ode/geoms.pyx":34 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 34; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":38 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomSphere *)__pyx_v_self)->__pyx_base.gid);

  /* "/home/jiba/src/soya/ode/geoms.pyx":39 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 39; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":49 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 49; goto __pyx_L1;}
  dGeomSphereSetRadius(((struct __pyx_obj_3ode_GeomSphere *)__pyx_v_self)->__pyx_base.gid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":56 */
  __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 = 56; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":69 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; 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 = 69; 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 = 69; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; 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 = 69; 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 = 69; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; 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 = 69; 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 = 69; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_k30;
  __pyx_v_lengths = __pyx_k31;
  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);
  ((PyObject*)__pyx_v_sp) = Py_None; Py_INCREF(((PyObject*)__pyx_v_sp));

  /* "/home/jiba/src/soya/ode/geoms.pyx":87 */
  __pyx_v_sid = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":88 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":89 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 89; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF((PyObject *)((PyObject *)__pyx_v_sp));
    ((PyObject *)__pyx_v_sp) = __pyx_v_space;

    /* "/home/jiba/src/soya/ode/geoms.pyx":90 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geoms.pyx":91 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 91; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_lengths, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 91; 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 = 91; 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 = 91; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_lengths, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 91; 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 = 91; 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 = 91; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_lengths, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 91; 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 = 91; 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/jiba/src/soya/ode/geoms.pyx":95 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 95; 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 = 95; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_2, __pyx_3, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 95; 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_k32;
  __pyx_v_lengths = __pyx_k33;
  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/jiba/src/soya/ode/geoms.pyx":98 */
  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/jiba/src/soya/ode/geoms.pyx":99 */
  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;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomBox.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  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/jiba/src/soya/ode/geoms.pyx":102 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 102; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":106 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomBox *)__pyx_v_self)->__pyx_base.gid);

  /* "/home/jiba/src/soya/ode/geoms.pyx":107 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 107; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":110 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_lengths, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; 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 = 110; 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 = 110; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_lengths, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; 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 = 110; 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 = 110; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_lengths, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; 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 = 110; 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(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":114 */
  dGeomBoxGetLengths(((struct __pyx_obj_3ode_GeomBox *)__pyx_v_self)->__pyx_base.gid,__pyx_v_res);

  /* "/home/jiba/src/soya/ode/geoms.pyx":115 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 115; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 115; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 115; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 115; 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(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":128 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 128; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 128; 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 = 128; 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 = 128; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 128; 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 = 128; 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 = 128; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 128; 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 = 128; 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 = 128; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_k34;
  __pyx_v_normal = __pyx_k35;
  __pyx_v_dist = __pyx_k36;
  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);
  ((PyObject*)__pyx_v_sp) = Py_None; Py_INCREF(((PyObject*)__pyx_v_sp));

  /* "/home/jiba/src/soya/ode/geoms.pyx":151 */
  __pyx_v_sid = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":152 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 152; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":153 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 153; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF((PyObject *)((PyObject *)__pyx_v_sp));
    ((PyObject *)__pyx_v_sp) = __pyx_v_space;

    /* "/home/jiba/src/soya/ode/geoms.pyx":154 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geoms.pyx":155 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 155; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_normal, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 155; 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 = 155; 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 = 155; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_normal, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 155; 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 = 155; 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 = 155; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_normal, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 155; 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 = 155; 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 = 155; 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/jiba/src/soya/ode/geoms.pyx":159 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 159; 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 = 159; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_2, __pyx_3, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 159; 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_k37;
  __pyx_v_normal = __pyx_k38;
  __pyx_v_dist = __pyx_k39;
  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/jiba/src/soya/ode/geoms.pyx":163 */
  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;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomPlane.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  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/jiba/src/soya/ode/geoms.pyx":168 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomPlane *)__pyx_v_self)->__pyx_base.gid);

  /* "/home/jiba/src/soya/ode/geoms.pyx":169 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 169; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":172 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; 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 = 172; 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 = 172; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; 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 = 172; 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 = 172; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; 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 = 172; 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 = 172; 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(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":176 */
  dGeomPlaneGetParams(((struct __pyx_obj_3ode_GeomPlane *)__pyx_v_self)->__pyx_base.gid,__pyx_v_res);

  /* "/home/jiba/src/soya/ode/geoms.pyx":177 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 177; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 177; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 177; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 177; 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 = 177; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 177; 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(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":190 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; 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 = 190; 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 = 190; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; 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 = 190; 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 = 190; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; 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 = 190; 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 = 190; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_13GeomCCylinder___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_13GeomCCylinder___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_k40;
  __pyx_v_radius = __pyx_k41;
  __pyx_v_length = __pyx_k42;
  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);
  ((PyObject*)__pyx_v_sp) = Py_None; Py_INCREF(((PyObject*)__pyx_v_sp));

  /* "/home/jiba/src/soya/ode/geoms.pyx":211 */
  __pyx_v_sid = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":212 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 212; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":213 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 213; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF((PyObject *)((PyObject *)__pyx_v_sp));
    ((PyObject *)__pyx_v_sp) = __pyx_v_space;

    /* "/home/jiba/src/soya/ode/geoms.pyx":214 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geoms.pyx":215 */
  __pyx_2 = PyFloat_AsDouble(__pyx_v_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 215; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_length); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 215; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_GeomCCylinder *)__pyx_v_self)->__pyx_base.gid = dCreateCCylinder(__pyx_v_sid,__pyx_2,__pyx_3);

  /* "/home/jiba/src/soya/ode/geoms.pyx":219 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 219; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(((long )((struct __pyx_obj_3ode_GeomCCylinder *)__pyx_v_self)->__pyx_base.gid)); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 219; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_4, __pyx_5, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 219; 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.GeomCCylinder.__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_13GeomCCylinder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_13GeomCCylinder___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_k43;
  __pyx_v_radius = __pyx_k44;
  __pyx_v_length = __pyx_k45;
  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/jiba/src/soya/ode/geoms.pyx":222 */
  Py_INCREF(__pyx_v_space);
  Py_DECREF(((struct __pyx_obj_3ode_GeomCCylinder *)__pyx_v_self)->__pyx_base.space);
  ((struct __pyx_obj_3ode_GeomCCylinder *)__pyx_v_self)->__pyx_base.space = __pyx_v_space;

  /* "/home/jiba/src/soya/ode/geoms.pyx":223 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_3ode_GeomCCylinder *)__pyx_v_self)->__pyx_base.body);
  ((struct __pyx_obj_3ode_GeomCCylinder *)__pyx_v_self)->__pyx_base.body = Py_None;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomCCylinder.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  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_13GeomCCylinder_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_13GeomCCylinder_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/jiba/src/soya/ode/geoms.pyx":226 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 226; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

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

static PyObject *__pyx_f_3ode_13GeomCCylinder__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_13GeomCCylinder__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/jiba/src/soya/ode/geoms.pyx":230 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomCCylinder *)__pyx_v_self)->__pyx_base.gid);

  /* "/home/jiba/src/soya/ode/geoms.pyx":231 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 231; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

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

static PyObject *__pyx_f_3ode_13GeomCCylinder_setParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_13GeomCCylinder_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/jiba/src/soya/ode/geoms.pyx":234 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 234; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_length); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 234; goto __pyx_L1;}
  dGeomCCylinderSetParams(((struct __pyx_obj_3ode_GeomCCylinder *)__pyx_v_self)->__pyx_base.gid,__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomCCylinder.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_13GeomCCylinder_getParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_13GeomCCylinder_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/jiba/src/soya/ode/geoms.pyx":238 */
  dGeomCCylinderGetParams(((struct __pyx_obj_3ode_GeomCCylinder *)__pyx_v_self)->__pyx_base.gid,(&__pyx_v_radius),(&__pyx_v_length));

  /* "/home/jiba/src/soya/ode/geoms.pyx":239 */
  __pyx_1 = PyFloat_FromDouble(__pyx_v_radius); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble(__pyx_v_length); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; 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(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.GeomCCylinder.getParams");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_13GeomCCylinder_pointDepth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3ode_13GeomCCylinder_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_13GeomCCylinder_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/jiba/src/soya/ode/geoms.pyx":252 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 252; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 252; 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 = 252; 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 = 252; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 252; 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 = 252; 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 = 252; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 252; 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 = 252; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyFloat_FromDouble(dGeomCCylinderPointDepth(((struct __pyx_obj_3ode_GeomCCylinder *)__pyx_v_self)->__pyx_base.gid,__pyx_3,__pyx_4,__pyx_5)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 252; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("ode.GeomCCylinder.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_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_k46;
  __pyx_v_rlen = __pyx_k47;
  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);
  ((PyObject*)__pyx_v_sp) = Py_None; Py_INCREF(((PyObject*)__pyx_v_sp));

  /* "/home/jiba/src/soya/ode/geoms.pyx":274 */
  __pyx_v_sid = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":275 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 275; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":276 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF((PyObject *)((PyObject *)__pyx_v_sp));
    ((PyObject *)__pyx_v_sp) = __pyx_v_space;

    /* "/home/jiba/src/soya/ode/geoms.pyx":277 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geoms.pyx":278 */
  __pyx_2 = PyFloat_AsDouble(__pyx_v_rlen); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 278; goto __pyx_L1;}
  ((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.gid = dCreateRay(__pyx_v_sid,__pyx_2);

  /* "/home/jiba/src/soya/ode/geoms.pyx":282 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 282; 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 = 282; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_3, __pyx_4, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 282; 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_k48;
  __pyx_v_rlen = __pyx_k49;
  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/jiba/src/soya/ode/geoms.pyx":286 */
  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/jiba/src/soya/ode/geoms.pyx":287 */
  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;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomRay.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  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/jiba/src/soya/ode/geoms.pyx":291 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.gid);

  /* "/home/jiba/src/soya/ode/geoms.pyx":292 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 292; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":295 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_rlen); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 295; goto __pyx_L1;}
  dGeomRaySetLength(((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.gid,__pyx_1);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":298 */
  __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 = 298; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":301 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 301; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 301; 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 = 301; 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 = 301; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 301; 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 = 301; 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 = 301; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 301; 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 = 301; 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 = 301; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_u, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 301; 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 = 301; 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 = 301; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_u, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 301; 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 = 301; 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 = 301; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_u, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 301; 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 = 301; 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(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":306 */
  dGeomRayGet(((struct __pyx_obj_3ode_GeomRay *)__pyx_v_self)->__pyx_base.gid,__pyx_v_start,__pyx_v_dir);

  /* "/home/jiba/src/soya/ode/geoms.pyx":307 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_start[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 307; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_start[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 307; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_start[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 307; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 307; 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 = 307; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_dir[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 307; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_dir[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 307; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 307; 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 = 307; 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(__pyx_r);
  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_k50;
  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);
  ((PyObject*)__pyx_v_sp) = Py_None; Py_INCREF(((PyObject*)__pyx_v_sp));

  /* "/home/jiba/src/soya/ode/geoms.pyx":329 */
  __pyx_v_sid = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":330 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 330; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":331 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF((PyObject *)((PyObject *)__pyx_v_sp));
    ((PyObject *)__pyx_v_sp) = __pyx_v_space;

    /* "/home/jiba/src/soya/ode/geoms.pyx":332 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geoms.pyx":333 */
  ((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid = dCreateGeomTransform(__pyx_v_sid);

  /* "/home/jiba/src/soya/ode/geoms.pyx":336 */
  dGeomTransformSetCleanup(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid,0);

  /* "/home/jiba/src/soya/ode/geoms.pyx":340 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 340; 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 = 340; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_2, __pyx_3, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 340; 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_k51;
  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/jiba/src/soya/ode/geoms.pyx":343 */
  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/jiba/src/soya/ode/geoms.pyx":344 */
  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/jiba/src/soya/ode/geoms.pyx":345 */
  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/jiba/src/soya/ode/geoms.pyx":347 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 347; 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/jiba/src/soya/ode/geoms.pyx":350 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":354 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid);

  /* "/home/jiba/src/soya/ode/geoms.pyx":355 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 355; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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_k84p;
static PyObject *__pyx_k85p;
static PyObject *__pyx_k86p;

static char (__pyx_k84[]) = "Only placeable geoms can be encapsulated by a GeomTransform";
static char (__pyx_k85[]) = "The encapsulated geom was already inserted into a space.";
static char (__pyx_k86[]) = "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;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  int __pyx_5;
  long __pyx_6;
  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 = 357; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/geoms.pyx":370 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_geom), __pyx_n_placeable); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyObject_IsTrue(__pyx_3); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = (!__pyx_4);
  if (__pyx_5) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":371 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_k84p, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 371; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geoms.pyx":372 */
  __pyx_4 = (dGeomGetSpace(__pyx_v_geom->gid) != ((dSpaceID )0));
  if (__pyx_4) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":373 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 373; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k85p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 373; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/jiba/src/soya/ode/geoms.pyx":374 */
  __pyx_5 = (dGeomGetBody(__pyx_v_geom->gid) != ((dBodyID )0));
  if (__pyx_5) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":375 */
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 375; goto __pyx_L1;}
    __Pyx_Raise(__pyx_3, __pyx_k86p, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 375; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/jiba/src/soya/ode/geoms.pyx":377 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_geom), __pyx_n__id); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_6 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_v_id = __pyx_6;

  /* "/home/jiba/src/soya/ode/geoms.pyx":378 */
  dGeomTransformSetGeom(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid,((dGeomID )__pyx_v_id));

  /* "/home/jiba/src/soya/ode/geoms.pyx":379 */
  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(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __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/jiba/src/soya/ode/geoms.pyx":386 */
  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(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomTransform.getGeom");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_k87p;

static char (__pyx_k87[]) = "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/jiba/src/soya/ode/geoms.pyx":403 */
  __pyx_1 = (__pyx_v_mode < 0);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_mode > 1);
  }
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":404 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 404; goto __pyx_L1;}
    __pyx_3 = PyInt_FromLong(__pyx_v_mode); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 404; goto __pyx_L1;}
    __pyx_4 = PyNumber_Remainder(__pyx_k87p, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 404; 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 = 404; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geoms.pyx":405 */
  dGeomTransformSetInfo(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid,__pyx_v_mode);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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/jiba/src/soya/ode/geoms.pyx":419 */
  __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 = 419; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  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 PyObject *__pyx_n_land;
static PyObject *__pyx_n_x;
static PyObject *__pyx_n_width;
static PyObject *__pyx_n_y;
static PyObject *__pyx_n_z;
static PyObject *__pyx_n_depth;

static void __pyx_f_3ode_LandGetAABB(dGeomID __pyx_v_geom,dReal (*__pyx_v_aabb)) {
  PyObject *__pyx_v_land;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  PyObject *__pyx_4 = 0;
  __pyx_v_land = Py_None; Py_INCREF(__pyx_v_land);

  /* "/home/jiba/src/soya/ode/landgeom.pyx":26 */
  __pyx_1 = ((PyObject *)_c2py_GeomLand(dGeomGetData(__pyx_v_geom))); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 26; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_land); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 26; goto __pyx_L1;}
  Py_DECREF((PyObject *)__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_land);
  __pyx_v_land = __pyx_2;
  __pyx_2 = 0;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":28 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_land, __pyx_n_x); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 28; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 28; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_aabb[0]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":29 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_land, __pyx_n_x); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 29; goto __pyx_L1;}
  __pyx_1 = PyObject_GetAttr(__pyx_v_land, __pyx_n_width); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 29; goto __pyx_L1;}
  __pyx_4 = PyNumber_Add(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 29; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 29; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  (__pyx_v_aabb[1]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":30 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_land, __pyx_n_y); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_aabb[2]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":31 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_land, __pyx_n_y); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 31; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 31; goto __pyx_L1;}
  __pyx_2 = PyNumber_Add(__pyx_1, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (__pyx_v_aabb[3]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":32 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_land, __pyx_n_z); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 32; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 32; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_aabb[4]) = __pyx_3;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":33 */
  __pyx_4 = PyObject_GetAttr(__pyx_v_land, __pyx_n_z); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 33; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_v_land, __pyx_n_depth); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 33; goto __pyx_L1;}
  __pyx_1 = PyNumber_Add(__pyx_4, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 33; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 33; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  (__pyx_v_aabb[5]) = __pyx_3;

  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_4);
  __Pyx_WriteUnraisable("ode.LandGetAABB");
  __pyx_L0:;
  Py_DECREF(__pyx_v_land);
}

static PyObject *__pyx_n_matrix;
static PyObject *__pyx_n_get_true_height_and_normal;

static int __pyx_f_3ode_LandBoxCollide(dGeomID __pyx_v_o1,dGeomID __pyx_v_o2,int __pyx_v_flags,dContactGeom (*__pyx_v_contact),int __pyx_v_skip) {
  PyObject *__pyx_v_land;
  int __pyx_v_p;
  int __pyx_v_num_contacts;
  dReal (*__pyx_v_R);
  dReal (*__pyx_v_P);
  dReal (__pyx_v_x[8]);
  dReal (__pyx_v_y[8]);
  dReal (__pyx_v_z[8]);
  dReal __pyx_v_i;
  dReal __pyx_v_j;
  dReal __pyx_v_k;
  dVector3 __pyx_v_box_sides;
  PyObject *__pyx_v_m;
  PyObject *__pyx_v_height;
  PyObject *__pyx_v_normal;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  dReal __pyx_4;
  PyObject *__pyx_5 = 0;
  int __pyx_6;
  __pyx_v_land = Py_None; Py_INCREF(__pyx_v_land);
  __pyx_v_m = Py_None; Py_INCREF(__pyx_v_m);
  __pyx_v_height = Py_None; Py_INCREF(__pyx_v_height);
  __pyx_v_normal = Py_None; Py_INCREF(__pyx_v_normal);

  /* "/home/jiba/src/soya/ode/landgeom.pyx":47 */
  __pyx_1 = ((PyObject *)_c2py_GeomLand(dGeomGetData(__pyx_v_o1))); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 47; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_land); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 47; goto __pyx_L1;}
  Py_DECREF((PyObject *)__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_land);
  __pyx_v_land = __pyx_2;
  __pyx_2 = 0;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":51 */
  dGeomBoxGetLengths(__pyx_v_o2,__pyx_v_box_sides);

  /* "/home/jiba/src/soya/ode/landgeom.pyx":53 */
  __pyx_v_R = dGeomGetRotation(__pyx_v_o2);

  /* "/home/jiba/src/soya/ode/landgeom.pyx":55 */
  (__pyx_v_x[0]) = (((((__pyx_v_R[0]) * (-(__pyx_v_box_sides[0]))) / 2.0) + (((__pyx_v_R[1]) * (-(__pyx_v_box_sides[1]))) / 2.0)) + (((__pyx_v_R[2]) * (-(__pyx_v_box_sides[2]))) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":56 */
  (__pyx_v_y[0]) = (((((__pyx_v_R[4]) * (-(__pyx_v_box_sides[0]))) / 2.0) + (((__pyx_v_R[5]) * (-(__pyx_v_box_sides[1]))) / 2.0)) + (((__pyx_v_R[6]) * (-(__pyx_v_box_sides[2]))) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":57 */
  (__pyx_v_z[0]) = (((((__pyx_v_R[8]) * (-(__pyx_v_box_sides[0]))) / 2.0) + (((__pyx_v_R[9]) * (-(__pyx_v_box_sides[1]))) / 2.0)) + (((__pyx_v_R[10]) * (-(__pyx_v_box_sides[2]))) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":59 */
  (__pyx_v_x[1]) = (((((__pyx_v_R[0]) * (__pyx_v_box_sides[0])) / 2.0) + (((__pyx_v_R[1]) * (-(__pyx_v_box_sides[1]))) / 2.0)) + (((__pyx_v_R[2]) * (-(__pyx_v_box_sides[2]))) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":60 */
  (__pyx_v_y[1]) = (((((__pyx_v_R[4]) * (__pyx_v_box_sides[0])) / 2.0) + (((__pyx_v_R[5]) * (-(__pyx_v_box_sides[1]))) / 2.0)) + (((__pyx_v_R[6]) * (-(__pyx_v_box_sides[2]))) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":61 */
  (__pyx_v_z[1]) = (((((__pyx_v_R[8]) * (__pyx_v_box_sides[0])) / 2.0) + (((__pyx_v_R[9]) * (-(__pyx_v_box_sides[1]))) / 2.0)) + (((__pyx_v_R[10]) * (-(__pyx_v_box_sides[2]))) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":63 */
  (__pyx_v_x[2]) = (((((__pyx_v_R[0]) * (__pyx_v_box_sides[0])) / 2.0) + (((__pyx_v_R[1]) * (__pyx_v_box_sides[1])) / 2.0)) + (((__pyx_v_R[2]) * (-(__pyx_v_box_sides[2]))) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":64 */
  (__pyx_v_y[2]) = (((((__pyx_v_R[4]) * (__pyx_v_box_sides[0])) / 2.0) + (((__pyx_v_R[5]) * (__pyx_v_box_sides[1])) / 2.0)) + (((__pyx_v_R[6]) * (-(__pyx_v_box_sides[2]))) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":65 */
  (__pyx_v_z[2]) = (((((__pyx_v_R[8]) * (__pyx_v_box_sides[0])) / 2.0) + (((__pyx_v_R[9]) * (__pyx_v_box_sides[1])) / 2.0)) + (((__pyx_v_R[10]) * (-(__pyx_v_box_sides[2]))) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":67 */
  (__pyx_v_x[3]) = (((((__pyx_v_R[0]) * (-(__pyx_v_box_sides[0]))) / 2.0) + (((__pyx_v_R[1]) * (__pyx_v_box_sides[1])) / 2.0)) + (((__pyx_v_R[2]) * (-(__pyx_v_box_sides[2]))) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":68 */
  (__pyx_v_y[3]) = (((((__pyx_v_R[4]) * (-(__pyx_v_box_sides[0]))) / 2.0) + (((__pyx_v_R[5]) * (__pyx_v_box_sides[1])) / 2.0)) + (((__pyx_v_R[6]) * (-(__pyx_v_box_sides[2]))) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":69 */
  (__pyx_v_z[3]) = (((((__pyx_v_R[8]) * (-(__pyx_v_box_sides[0]))) / 2.0) + (((__pyx_v_R[9]) * (__pyx_v_box_sides[1])) / 2.0)) + (((__pyx_v_R[10]) * (-(__pyx_v_box_sides[2]))) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":71 */
  (__pyx_v_x[4]) = (((((__pyx_v_R[0]) * (-(__pyx_v_box_sides[0]))) / 2.0) + (((__pyx_v_R[1]) * (-(__pyx_v_box_sides[1]))) / 2.0)) + (((__pyx_v_R[2]) * (__pyx_v_box_sides[2])) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":72 */
  (__pyx_v_y[4]) = (((((__pyx_v_R[4]) * (-(__pyx_v_box_sides[0]))) / 2.0) + (((__pyx_v_R[5]) * (-(__pyx_v_box_sides[1]))) / 2.0)) + (((__pyx_v_R[6]) * (__pyx_v_box_sides[2])) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":73 */
  (__pyx_v_z[4]) = (((((__pyx_v_R[8]) * (-(__pyx_v_box_sides[0]))) / 2.0) + (((__pyx_v_R[9]) * (-(__pyx_v_box_sides[1]))) / 2.0)) + (((__pyx_v_R[10]) * (__pyx_v_box_sides[2])) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":75 */
  (__pyx_v_x[5]) = (((((__pyx_v_R[0]) * (__pyx_v_box_sides[0])) / 2.0) + (((__pyx_v_R[1]) * (-(__pyx_v_box_sides[1]))) / 2.0)) + (((__pyx_v_R[2]) * (__pyx_v_box_sides[2])) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":76 */
  (__pyx_v_y[5]) = (((((__pyx_v_R[4]) * (__pyx_v_box_sides[0])) / 2.0) + (((__pyx_v_R[5]) * (-(__pyx_v_box_sides[1]))) / 2.0)) + (((__pyx_v_R[6]) * (__pyx_v_box_sides[2])) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":77 */
  (__pyx_v_z[5]) = (((((__pyx_v_R[8]) * (__pyx_v_box_sides[0])) / 2.0) + (((__pyx_v_R[9]) * (-(__pyx_v_box_sides[1]))) / 2.0)) + (((__pyx_v_R[10]) * (__pyx_v_box_sides[2])) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":79 */
  (__pyx_v_x[6]) = (((((__pyx_v_R[0]) * (__pyx_v_box_sides[0])) / 2.0) + (((__pyx_v_R[1]) * (__pyx_v_box_sides[1])) / 2.0)) + (((__pyx_v_R[2]) * (__pyx_v_box_sides[2])) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":80 */
  (__pyx_v_y[6]) = (((((__pyx_v_R[4]) * (__pyx_v_box_sides[0])) / 2.0) + (((__pyx_v_R[5]) * (__pyx_v_box_sides[1])) / 2.0)) + (((__pyx_v_R[6]) * (__pyx_v_box_sides[2])) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":81 */
  (__pyx_v_z[6]) = (((((__pyx_v_R[8]) * (__pyx_v_box_sides[0])) / 2.0) + (((__pyx_v_R[9]) * (__pyx_v_box_sides[1])) / 2.0)) + (((__pyx_v_R[10]) * (__pyx_v_box_sides[2])) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":83 */
  (__pyx_v_x[7]) = (((((__pyx_v_R[0]) * (-(__pyx_v_box_sides[0]))) / 2.0) + (((__pyx_v_R[1]) * (__pyx_v_box_sides[1])) / 2.0)) + (((__pyx_v_R[2]) * (__pyx_v_box_sides[2])) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":84 */
  (__pyx_v_y[7]) = (((((__pyx_v_R[4]) * (-(__pyx_v_box_sides[0]))) / 2.0) + (((__pyx_v_R[5]) * (__pyx_v_box_sides[1])) / 2.0)) + (((__pyx_v_R[6]) * (__pyx_v_box_sides[2])) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":85 */
  (__pyx_v_z[7]) = (((((__pyx_v_R[8]) * (-(__pyx_v_box_sides[0]))) / 2.0) + (((__pyx_v_R[9]) * (__pyx_v_box_sides[1])) / 2.0)) + (((__pyx_v_R[10]) * (__pyx_v_box_sides[2])) / 2.0));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":88 */
  __pyx_v_P = dGeomGetPosition(__pyx_v_o2);

  /* "/home/jiba/src/soya/ode/landgeom.pyx":89 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_land, __pyx_n_matrix); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 89; goto __pyx_L1;}
  Py_DECREF(__pyx_v_m);
  __pyx_v_m = __pyx_1;
  __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":90 */
  __pyx_v_num_contacts = 0;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":93 */
  for (__pyx_v_p = 0; __pyx_v_p < 8; ++__pyx_v_p) {

    /* "/home/jiba/src/soya/ode/landgeom.pyx":95 */
    (__pyx_v_x[__pyx_v_p]) = ((__pyx_v_x[__pyx_v_p]) + (__pyx_v_P[0]));

    /* "/home/jiba/src/soya/ode/landgeom.pyx":96 */
    (__pyx_v_y[__pyx_v_p]) = ((__pyx_v_y[__pyx_v_p]) + (__pyx_v_P[1]));

    /* "/home/jiba/src/soya/ode/landgeom.pyx":97 */
    (__pyx_v_z[__pyx_v_p]) = ((__pyx_v_z[__pyx_v_p]) + (__pyx_v_P[2]));

    /* "/home/jiba/src/soya/ode/landgeom.pyx":104 */
    __pyx_2 = PyFloat_FromDouble((__pyx_v_x[__pyx_v_p])); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 104; goto __pyx_L1;}
    __pyx_1 = PyObject_GetAttr(__pyx_v_land, __pyx_n_x); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 104; goto __pyx_L1;}
    __pyx_3 = PyNumber_Subtract(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 104; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 104; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_v_i = __pyx_4;

    /* "/home/jiba/src/soya/ode/landgeom.pyx":105 */
    __pyx_2 = PyFloat_FromDouble((__pyx_v_y[__pyx_v_p])); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 105; goto __pyx_L1;}
    __pyx_1 = PyObject_GetAttr(__pyx_v_land, __pyx_n_y); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 105; goto __pyx_L1;}
    __pyx_3 = PyNumber_Subtract(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 105; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 105; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_v_j = __pyx_4;

    /* "/home/jiba/src/soya/ode/landgeom.pyx":106 */
    __pyx_2 = PyFloat_FromDouble((__pyx_v_z[__pyx_v_p])); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 106; goto __pyx_L1;}
    __pyx_1 = PyObject_GetAttr(__pyx_v_land, __pyx_n_z); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 106; goto __pyx_L1;}
    __pyx_3 = PyNumber_Subtract(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 106; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 106; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_v_k = __pyx_4;

    /* "/home/jiba/src/soya/ode/landgeom.pyx":108 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_land, __pyx_n_get_true_height_and_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 108; goto __pyx_L1;}
    __pyx_1 = PyFloat_FromDouble(__pyx_v_i); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 108; goto __pyx_L1;}
    __pyx_3 = PyFloat_FromDouble(__pyx_v_k); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 108; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 108; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);
    PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
    __pyx_1 = 0;
    __pyx_3 = 0;
    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 108; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    __pyx_3 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 108; goto __pyx_L1;}
    Py_DECREF(__pyx_v_height);
    __pyx_v_height = __pyx_3;
    __pyx_3 = 0;
    __pyx_2 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 108; goto __pyx_L1;}
    Py_DECREF(__pyx_v_normal);
    __pyx_v_normal = __pyx_2;
    __pyx_2 = 0;
    if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 108; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;

    /* "/home/jiba/src/soya/ode/landgeom.pyx":110 */
    __pyx_5 = PyFloat_FromDouble(__pyx_v_j); if (!__pyx_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; goto __pyx_L1;}
    if (PyObject_Cmp(__pyx_5, __pyx_v_height, &__pyx_6) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; goto __pyx_L1;}
    __pyx_6 = __pyx_6 > 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    if (__pyx_6) {

      /* "/home/jiba/src/soya/ode/landgeom.pyx":111 */
      goto __pyx_L2;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/jiba/src/soya/ode/landgeom.pyx":114 */
    ((__pyx_v_contact[__pyx_v_num_contacts]).pos[0]) = (__pyx_v_x[__pyx_v_p]);

    /* "/home/jiba/src/soya/ode/landgeom.pyx":115 */
    __pyx_3 = PyObject_GetAttr(__pyx_v_land, __pyx_n_y); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 115; goto __pyx_L1;}
    __pyx_2 = PyNumber_Add(__pyx_v_height, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 115; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 115; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    ((__pyx_v_contact[__pyx_v_num_contacts]).pos[1]) = __pyx_4;

    /* "/home/jiba/src/soya/ode/landgeom.pyx":116 */
    ((__pyx_v_contact[__pyx_v_num_contacts]).pos[2]) = (__pyx_v_z[__pyx_v_p]);

    /* "/home/jiba/src/soya/ode/landgeom.pyx":117 */
    ((__pyx_v_contact[__pyx_v_num_contacts]).normal[0]) = 0.0;

    /* "/home/jiba/src/soya/ode/landgeom.pyx":118 */
    ((__pyx_v_contact[__pyx_v_num_contacts]).normal[1]) = (-1.0);

    /* "/home/jiba/src/soya/ode/landgeom.pyx":119 */
    ((__pyx_v_contact[__pyx_v_num_contacts]).normal[2]) = 0.0;

    /* "/home/jiba/src/soya/ode/landgeom.pyx":120 */
    __pyx_1 = PyFloat_FromDouble(__pyx_v_j); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; goto __pyx_L1;}
    __pyx_5 = PyNumber_Subtract(__pyx_v_height, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_4 = PyFloat_AsDouble(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    (__pyx_v_contact[__pyx_v_num_contacts]).depth = __pyx_4;

    /* "/home/jiba/src/soya/ode/landgeom.pyx":121 */
    (__pyx_v_contact[__pyx_v_num_contacts]).g1 = __pyx_v_o1;

    /* "/home/jiba/src/soya/ode/landgeom.pyx":122 */
    (__pyx_v_contact[__pyx_v_num_contacts]).g2 = __pyx_v_o2;

    /* "/home/jiba/src/soya/ode/landgeom.pyx":123 */
    __pyx_v_num_contacts = (__pyx_v_num_contacts + 1);
    __pyx_L2:;
  }
  __pyx_L3:;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":125 */
  __pyx_r = __pyx_v_num_contacts;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_5);
  __Pyx_WriteUnraisable("ode.LandBoxCollide");
  __pyx_L0:;
  Py_DECREF(__pyx_v_land);
  Py_DECREF(__pyx_v_m);
  Py_DECREF(__pyx_v_height);
  Py_DECREF(__pyx_v_normal);
  return __pyx_r;
}

static dColliderFn (*__pyx_f_3ode_LandGetColliderFn(int __pyx_v_gclass)) {
  dColliderFn (*__pyx_r);
  int __pyx_1;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":130 */
  __pyx_1 = (__pyx_v_gclass == dBoxClass);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/landgeom.pyx":131 */
    __pyx_r = __pyx_f_3ode_LandBoxCollide;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":133 */
  __pyx_r = 0;
  goto __pyx_L0;

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("ode.LandGetColliderFn");
  __pyx_L0:;
  return __pyx_r;
}

static int __pyx_f_3ode_LandAABBTest(dGeomID __pyx_v_o1,dGeomID __pyx_v_o2,dReal (*__pyx_v_aabb2)) {
  int __pyx_r;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":137 */

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("ode.LandAABBTest");
  __pyx_L0:;
  return __pyx_r;
}

static int __pyx_f_3ode_8GeomLand___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_8GeomLand___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_land = 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[] = {"land","space",0};
  __pyx_v_space = __pyx_k52;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_land, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_land);
  Py_INCREF(__pyx_v_space);
  ((PyObject*)__pyx_v_sp) = Py_None; Py_INCREF(((PyObject*)__pyx_v_sp));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":157 */
  __pyx_v_sid = 0;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":159 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 159; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/landgeom.pyx":160 */
    if (!__Pyx_TypeTest(__pyx_v_space, __pyx_ptype_3ode_SpaceBase)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 160; goto __pyx_L1;}
    Py_INCREF(__pyx_v_space);
    Py_DECREF((PyObject *)((PyObject *)__pyx_v_sp));
    ((PyObject *)__pyx_v_sp) = __pyx_v_space;

    /* "/home/jiba/src/soya/ode/landgeom.pyx":161 */
    __pyx_v_sid = __pyx_v_sp->sid;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":163 */
  ((struct __pyx_obj_3ode_GeomLand *)__pyx_v_self)->__pyx_base.gid = dCreateGeom(__pyx_v_3ode_dLandClass);

  /* "/home/jiba/src/soya/ode/landgeom.pyx":165 */
  if (PyObject_Cmp(__pyx_v_space, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 165; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/landgeom.pyx":166 */
    dSpaceAdd(__pyx_v_sid,((struct __pyx_obj_3ode_GeomLand *)__pyx_v_self)->__pyx_base.gid);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":169 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_land, __pyx_v_land) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 169; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/landgeom.pyx":171 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__geom_c2py_lut); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 171; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(((long )((struct __pyx_obj_3ode_GeomLand *)__pyx_v_self)->__pyx_base.gid)); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 171; goto __pyx_L1;}
  if (PyObject_SetItem(__pyx_2, __pyx_3, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 171; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":172 */
  dGeomSetData(((struct __pyx_obj_3ode_GeomLand *)__pyx_v_self)->__pyx_base.gid,((void (*))__pyx_v_self));

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ode.GeomLand.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_sp);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_land);
  Py_DECREF(__pyx_v_space);
  return __pyx_r;
}

static PyObject *__pyx_n_dealloc;


static void __pyx_f_3ode_8GeomLand___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_f_3ode_8GeomLand___dealloc__(PyObject *__pyx_v_self) {
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/landgeom.pyx":175 */
  if (__Pyx_PrintItem(__pyx_n_dealloc) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 175; goto __pyx_L1;}
  if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 175; goto __pyx_L1;}

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomLand.__dealloc__");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
}

static int __pyx_f_3ode_8GeomLand___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_3ode_8GeomLand___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_land = 0;
  PyObject *__pyx_v_space = 0;
  int __pyx_r;
  static char *__pyx_argnames[] = {"land","space",0};
  __pyx_v_space = __pyx_k53;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_land, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_land);
  Py_INCREF(__pyx_v_space);

  /* "/home/jiba/src/soya/ode/landgeom.pyx":178 */
  Py_INCREF(__pyx_v_space);
  Py_DECREF(((struct __pyx_obj_3ode_GeomLand *)__pyx_v_self)->__pyx_base.space);
  ((struct __pyx_obj_3ode_GeomLand *)__pyx_v_self)->__pyx_base.space = __pyx_v_space;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.GeomLand.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_land);
  Py_DECREF(__pyx_v_space);
  return __pyx_r;
}

static PyObject *__pyx_f_3ode_8GeomLand_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_8GeomLand_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/jiba/src/soya/ode/landgeom.pyx":182 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 182; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

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

static PyObject *__pyx_f_3ode_8GeomLand__id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3ode_8GeomLand__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/jiba/src/soya/ode/landgeom.pyx":186 */
  __pyx_v_id = ((long )((struct __pyx_obj_3ode_GeomLand *)__pyx_v_self)->__pyx_base.gid);

  /* "/home/jiba/src/soya/ode/landgeom.pyx":187 */
  __pyx_1 = PyInt_FromLong(__pyx_v_id); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 187; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ode.GeomLand._id");
  __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[] = "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    ";
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;
  PyObject *__pyx_3 = 0;
  long __pyx_4;
  int __pyx_5;
  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);
  ((PyObject*)__pyx_v_cont) = Py_None; Py_INCREF(((PyObject*)__pyx_v_cont));
  __pyx_v_res = Py_None; Py_INCREF(__pyx_v_res);

  /* "/home/jiba/src/soya/ode/ode.pyx":189 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_geom1, __pyx_n__id); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 189; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 189; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 189; 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[9]; __pyx_lineno = 189; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_v_id1 = __pyx_4;

  /* "/home/jiba/src/soya/ode/ode.pyx":190 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_geom2, __pyx_n__id); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 190; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 190; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 190; 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[9]; __pyx_lineno = 190; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_v_id2 = __pyx_4;

  /* "/home/jiba/src/soya/ode/ode.pyx":192 */
  __pyx_v_n = dCollide(((dGeomID )__pyx_v_id1),((dGeomID )__pyx_v_id2),150,__pyx_v_c,(sizeof(dContactGeom )));

  /* "/home/jiba/src/soya/ode/ode.pyx":193 */
  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 193; goto __pyx_L1;}
  Py_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_1;
  __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":194 */
  __pyx_v_i = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":195 */
  while (1) {
    __pyx_L2:;
    __pyx_5 = (__pyx_v_i < __pyx_v_n);
    if (!__pyx_5) break;

    /* "/home/jiba/src/soya/ode/ode.pyx":196 */
    __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 196; goto __pyx_L1;}
    __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_3ode_Contact), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 196; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_3ode_Contact)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 196; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_cont));
    ((PyObject *)__pyx_v_cont) = __pyx_3;
    __pyx_3 = 0;

    /* "/home/jiba/src/soya/ode/ode.pyx":197 */
    __pyx_v_cont->_contact.geom = (__pyx_v_c[__pyx_v_i]);

    /* "/home/jiba/src/soya/ode/ode.pyx":198 */
    __pyx_1 = PyObject_GetAttr(__pyx_v_res, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 198; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 198; goto __pyx_L1;}
    Py_INCREF(((PyObject *)__pyx_v_cont));
    PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_cont));
    __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 198; 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/jiba/src/soya/ode/ode.pyx":199 */
    __pyx_v_i = (__pyx_v_i + 1);
  }
  __pyx_L3:;

  /* "/home/jiba/src/soya/ode/ode.pyx":201 */
  Py_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __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_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/jiba/src/soya/ode/ode.pyx":209 */
  dCloseODE();

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("ode.CloseODE");
  __pyx_r = 0;
  __pyx_L0:;
  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_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_ParamCFM, "ParamCFM"},
  {&__pyx_n_ParamCFM2, "ParamCFM2"},
  {&__pyx_n_ParamFMax, "ParamFMax"},
  {&__pyx_n_ParamFMax2, "ParamFMax2"},
  {&__pyx_n_ParamFudgeFactor, "ParamFudgeFactor"},
  {&__pyx_n_ParamFudgeFactor2, "ParamFudgeFactor2"},
  {&__pyx_n_ParamHiStop, "ParamHiStop"},
  {&__pyx_n_ParamHiStop2, "ParamHiStop2"},
  {&__pyx_n_ParamLoStop, "ParamLoStop"},
  {&__pyx_n_ParamLoStop2, "ParamLoStop2"},
  {&__pyx_n_ParamStopCFM, "ParamStopCFM"},
  {&__pyx_n_ParamStopCFM2, "ParamStopCFM2"},
  {&__pyx_n_ParamStopERP, "ParamStopERP"},
  {&__pyx_n_ParamStopERP2, "ParamStopERP2"},
  {&__pyx_n_ParamSuspensionCFM, "ParamSuspensionCFM"},
  {&__pyx_n_ParamSuspensionCFM2, "ParamSuspensionCFM2"},
  {&__pyx_n_ParamSuspensionERP, "ParamSuspensionERP"},
  {&__pyx_n_ParamSuspensionERP2, "ParamSuspensionERP2"},
  {&__pyx_n_ParamVel, "ParamVel"},
  {&__pyx_n_ParamVel2, "ParamVel2"},
  {&__pyx_n_RuntimeError, "RuntimeError"},
  {&__pyx_n_Space, "Space"},
  {&__pyx_n_True, "True"},
  {&__pyx_n_ValueError, "ValueError"},
  {&__pyx_n___doc__, "__doc__"},
  {&__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_c, "c"},
  {&__pyx_n_collide, "collide"},
  {&__pyx_n_dealloc, "dealloc"},
  {&__pyx_n_depth, "depth"},
  {&__pyx_n_environment, "environment"},
  {&__pyx_n_get_true_height_and_normal, "get_true_height_and_normal"},
  {&__pyx_n_land, "land"},
  {&__pyx_n_mass, "mass"},
  {&__pyx_n_matrix, "matrix"},
  {&__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_str, "str"},
  {&__pyx_n_width, "width"},
  {&__pyx_n_x, "x"},
  {&__pyx_n_y, "y"},
  {&__pyx_n_z, "z"},
  {0, 0}
};

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_k1p, __pyx_k1, sizeof(__pyx_k1)},
  {&__pyx_k57p, __pyx_k57, sizeof(__pyx_k57)},
  {&__pyx_k58p, __pyx_k58, sizeof(__pyx_k58)},
  {&__pyx_k61p, __pyx_k61, sizeof(__pyx_k61)},
  {&__pyx_k63p, __pyx_k63, sizeof(__pyx_k63)},
  {&__pyx_k64p, __pyx_k64, sizeof(__pyx_k64)},
  {&__pyx_k65p, __pyx_k65, sizeof(__pyx_k65)},
  {&__pyx_k66p, __pyx_k66, sizeof(__pyx_k66)},
  {&__pyx_k67p, __pyx_k67, sizeof(__pyx_k67)},
  {&__pyx_k68p, __pyx_k68, sizeof(__pyx_k68)},
  {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)},
  {&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)},
  {&__pyx_k71p, __pyx_k71, sizeof(__pyx_k71)},
  {&__pyx_k72p, __pyx_k72, sizeof(__pyx_k72)},
  {&__pyx_k73p, __pyx_k73, sizeof(__pyx_k73)},
  {&__pyx_k74p, __pyx_k74, sizeof(__pyx_k74)},
  {&__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)},
  {0, 0, 0}
};

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(p->space);
  p->body = Py_None; Py_INCREF(p->body);
  p->attribs = Py_None; Py_INCREF(p->attribs);
  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(p->space);
  Py_XDECREF(p->body);
  p->body = Py_None; Py_INCREF(p->body);
  Py_XDECREF(p->attribs);
  p->attribs = Py_None; Py_INCREF(p->attribs);
  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},
  {"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*/
};

statichere 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_GeomLand(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_GeomObject->tp_new(t, a, k);
  struct __pyx_obj_3ode_GeomLand *p = (struct __pyx_obj_3ode_GeomLand *)o;
  if (__pyx_f_3ode_8GeomLand___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_GeomLand(PyObject *o) {
  struct __pyx_obj_3ode_GeomLand *p = (struct __pyx_obj_3ode_GeomLand *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_3ode_8GeomLand___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_GeomLand(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_GeomLand *p = (struct __pyx_obj_3ode_GeomLand *)o;
  __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_GeomLand(PyObject *o) {
  struct __pyx_obj_3ode_GeomLand *p = (struct __pyx_obj_3ode_GeomLand *)o;
  __pyx_ptype_3ode_GeomObject->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_GeomLand[] = {
  {"placeable", (PyCFunction)__pyx_f_3ode_8GeomLand_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {"_id", (PyCFunction)__pyx_f_3ode_8GeomLand__id, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_GeomLand = {
  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_GeomLand = {
  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_GeomLand = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_GeomLand = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

statichere PyTypeObject __pyx_type_3ode_GeomLand = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.GeomLand", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_GeomLand), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_GeomLand, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_GeomLand, /*tp_as_number*/
  &__pyx_tp_as_sequence_GeomLand, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_GeomLand, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_GeomLand, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3ode_GeomLand, /*tp_traverse*/
  __pyx_tp_clear_3ode_GeomLand, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_GeomLand, /*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_8GeomLand___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_GeomLand, /*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_Mass(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  struct __pyx_obj_3ode_Mass *p = (struct __pyx_obj_3ode_Mass *)o;
  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) {
  struct __pyx_obj_3ode_Mass *p = (struct __pyx_obj_3ode_Mass *)o;
  (*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_3ode_Mass(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_Mass *p = (struct __pyx_obj_3ode_Mass *)o;
  return 0;
}

static int __pyx_tp_clear_3ode_Mass(PyObject *o) {
  struct __pyx_obj_3ode_Mass *p = (struct __pyx_obj_3ode_Mass *)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},
  {"setCappedCylinder", (PyCFunction)__pyx_f_3ode_4Mass_setCappedCylinder, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_setCappedCylinder},
  {"setCylinder", (PyCFunction)__pyx_f_3ode_4Mass_setCylinder, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_setCylinder},
  {"setBox", (PyCFunction)__pyx_f_3ode_4Mass_setBox, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_4Mass_setBox},
  {"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*/
};

statichere 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, /*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);
  struct __pyx_obj_3ode_Contact *p = (struct __pyx_obj_3ode_Contact *)o;
  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) {
  struct __pyx_obj_3ode_Contact *p = (struct __pyx_obj_3ode_Contact *)o;
  (*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_3ode_Contact(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_Contact *p = (struct __pyx_obj_3ode_Contact *)o;
  return 0;
}

static int __pyx_tp_clear_3ode_Contact(PyObject *o) {
  struct __pyx_obj_3ode_Contact *p = (struct __pyx_obj_3ode_Contact *)o;
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_Contact[] = {
  {"getMode", (PyCFunction)__pyx_f_3ode_7Contact_getMode, METH_VARARGS|METH_KEYWORDS, 0},
  {"setMode", (PyCFunction)__pyx_f_3ode_7Contact_setMode, METH_VARARGS|METH_KEYWORDS, 0},
  {"getMu", (PyCFunction)__pyx_f_3ode_7Contact_getMu, METH_VARARGS|METH_KEYWORDS, 0},
  {"setMu", (PyCFunction)__pyx_f_3ode_7Contact_setMu, METH_VARARGS|METH_KEYWORDS, 0},
  {"getMu2", (PyCFunction)__pyx_f_3ode_7Contact_getMu2, METH_VARARGS|METH_KEYWORDS, 0},
  {"setMu2", (PyCFunction)__pyx_f_3ode_7Contact_setMu2, METH_VARARGS|METH_KEYWORDS, 0},
  {"getBounce", (PyCFunction)__pyx_f_3ode_7Contact_getBounce, METH_VARARGS|METH_KEYWORDS, 0},
  {"setBounce", (PyCFunction)__pyx_f_3ode_7Contact_setBounce, METH_VARARGS|METH_KEYWORDS, 0},
  {"getBounceVel", (PyCFunction)__pyx_f_3ode_7Contact_getBounceVel, METH_VARARGS|METH_KEYWORDS, 0},
  {"setBounceVel", (PyCFunction)__pyx_f_3ode_7Contact_setBounceVel, METH_VARARGS|METH_KEYWORDS, 0},
  {"getSoftERP", (PyCFunction)__pyx_f_3ode_7Contact_getSoftERP, METH_VARARGS|METH_KEYWORDS, 0},
  {"setSoftERP", (PyCFunction)__pyx_f_3ode_7Contact_setSoftERP, METH_VARARGS|METH_KEYWORDS, 0},
  {"getSoftCFM", (PyCFunction)__pyx_f_3ode_7Contact_getSoftCFM, METH_VARARGS|METH_KEYWORDS, 0},
  {"setSoftCFM", (PyCFunction)__pyx_f_3ode_7Contact_setSoftCFM, METH_VARARGS|METH_KEYWORDS, 0},
  {"getMotion1", (PyCFunction)__pyx_f_3ode_7Contact_getMotion1, METH_VARARGS|METH_KEYWORDS, 0},
  {"setMotion1", (PyCFunction)__pyx_f_3ode_7Contact_setMotion1, METH_VARARGS|METH_KEYWORDS, 0},
  {"getMotion2", (PyCFunction)__pyx_f_3ode_7Contact_getMotion2, METH_VARARGS|METH_KEYWORDS, 0},
  {"setMotion2", (PyCFunction)__pyx_f_3ode_7Contact_setMotion2, METH_VARARGS|METH_KEYWORDS, 0},
  {"getSlip1", (PyCFunction)__pyx_f_3ode_7Contact_getSlip1, METH_VARARGS|METH_KEYWORDS, 0},
  {"setSlip1", (PyCFunction)__pyx_f_3ode_7Contact_setSlip1, METH_VARARGS|METH_KEYWORDS, 0},
  {"getSlip2", (PyCFunction)__pyx_f_3ode_7Contact_getSlip2, METH_VARARGS|METH_KEYWORDS, 0},
  {"setSlip2", (PyCFunction)__pyx_f_3ode_7Contact_setSlip2, METH_VARARGS|METH_KEYWORDS, 0},
  {"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*/
};

statichere 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, /*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);
  struct __pyx_obj_3ode_World *p = (struct __pyx_obj_3ode_World *)o;
  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) {
  struct __pyx_obj_3ode_World *p = (struct __pyx_obj_3ode_World *)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) {
  int e;
  struct __pyx_obj_3ode_World *p = (struct __pyx_obj_3ode_World *)o;
  return 0;
}

static int __pyx_tp_clear_3ode_World(PyObject *o) {
  struct __pyx_obj_3ode_World *p = (struct __pyx_obj_3ode_World *)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*/
};

statichere 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, /*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(p->world);
  p->userattribs = Py_None; Py_INCREF(p->userattribs);
  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(p->world);
  Py_XDECREF(p->userattribs);
  p->userattribs = Py_None; Py_INCREF(p->userattribs);
  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*/
};

statichere 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(p->jointlist);
  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(p->jointlist);
  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*/
};

statichere 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(p->world);
  p->body1 = Py_None; Py_INCREF(p->body1);
  p->body2 = Py_None; Py_INCREF(p->body2);
  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);
  (*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;
  }
  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(p->world);
  Py_XDECREF(p->body1);
  p->body1 = Py_None; Py_INCREF(p->body1);
  Py_XDECREF(p->body2);
  p->body2 = Py_None; Py_INCREF(p->body2);
  return 0;
}

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*/
};

statichere 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*/
  0, /*tp_getattro*/
  0, /*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);
  struct __pyx_obj_3ode_BallJoint *p = (struct __pyx_obj_3ode_BallJoint *)o;
  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) {
  struct __pyx_obj_3ode_BallJoint *p = (struct __pyx_obj_3ode_BallJoint *)o;
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_BallJoint(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_BallJoint *p = (struct __pyx_obj_3ode_BallJoint *)o;
  __pyx_ptype_3ode_Joint->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_BallJoint(PyObject *o) {
  struct __pyx_obj_3ode_BallJoint *p = (struct __pyx_obj_3ode_BallJoint *)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*/
};

statichere 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, /*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);
  struct __pyx_obj_3ode_HingeJoint *p = (struct __pyx_obj_3ode_HingeJoint *)o;
  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) {
  struct __pyx_obj_3ode_HingeJoint *p = (struct __pyx_obj_3ode_HingeJoint *)o;
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_HingeJoint(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_HingeJoint *p = (struct __pyx_obj_3ode_HingeJoint *)o;
  __pyx_ptype_3ode_Joint->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_HingeJoint(PyObject *o) {
  struct __pyx_obj_3ode_HingeJoint *p = (struct __pyx_obj_3ode_HingeJoint *)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},
  {"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*/
};

statichere 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, /*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);
  struct __pyx_obj_3ode_SliderJoint *p = (struct __pyx_obj_3ode_SliderJoint *)o;
  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) {
  struct __pyx_obj_3ode_SliderJoint *p = (struct __pyx_obj_3ode_SliderJoint *)o;
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_SliderJoint(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_SliderJoint *p = (struct __pyx_obj_3ode_SliderJoint *)o;
  __pyx_ptype_3ode_Joint->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_SliderJoint(PyObject *o) {
  struct __pyx_obj_3ode_SliderJoint *p = (struct __pyx_obj_3ode_SliderJoint *)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},
  {"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*/
};

statichere 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, /*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);
  struct __pyx_obj_3ode_UniversalJoint *p = (struct __pyx_obj_3ode_UniversalJoint *)o;
  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) {
  struct __pyx_obj_3ode_UniversalJoint *p = (struct __pyx_obj_3ode_UniversalJoint *)o;
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_UniversalJoint(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_UniversalJoint *p = (struct __pyx_obj_3ode_UniversalJoint *)o;
  __pyx_ptype_3ode_Joint->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_UniversalJoint(PyObject *o) {
  struct __pyx_obj_3ode_UniversalJoint *p = (struct __pyx_obj_3ode_UniversalJoint *)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},
  {"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*/
};

statichere 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, /*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);
  struct __pyx_obj_3ode_Hinge2Joint *p = (struct __pyx_obj_3ode_Hinge2Joint *)o;
  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) {
  struct __pyx_obj_3ode_Hinge2Joint *p = (struct __pyx_obj_3ode_Hinge2Joint *)o;
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_Hinge2Joint(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_Hinge2Joint *p = (struct __pyx_obj_3ode_Hinge2Joint *)o;
  __pyx_ptype_3ode_Joint->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_Hinge2Joint(PyObject *o) {
  struct __pyx_obj_3ode_Hinge2Joint *p = (struct __pyx_obj_3ode_Hinge2Joint *)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},
  {"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*/
};

statichere 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, /*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);
  struct __pyx_obj_3ode_FixedJoint *p = (struct __pyx_obj_3ode_FixedJoint *)o;
  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) {
  struct __pyx_obj_3ode_FixedJoint *p = (struct __pyx_obj_3ode_FixedJoint *)o;
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_FixedJoint(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_FixedJoint *p = (struct __pyx_obj_3ode_FixedJoint *)o;
  __pyx_ptype_3ode_Joint->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_FixedJoint(PyObject *o) {
  struct __pyx_obj_3ode_FixedJoint *p = (struct __pyx_obj_3ode_FixedJoint *)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*/
};

statichere 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, /*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);
  struct __pyx_obj_3ode_ContactJoint *p = (struct __pyx_obj_3ode_ContactJoint *)o;
  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) {
  struct __pyx_obj_3ode_ContactJoint *p = (struct __pyx_obj_3ode_ContactJoint *)o;
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_ContactJoint(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_ContactJoint *p = (struct __pyx_obj_3ode_ContactJoint *)o;
  __pyx_ptype_3ode_Joint->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_ContactJoint(PyObject *o) {
  struct __pyx_obj_3ode_ContactJoint *p = (struct __pyx_obj_3ode_ContactJoint *)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*/
};

statichere 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, /*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);
  struct __pyx_obj_3ode_AMotor *p = (struct __pyx_obj_3ode_AMotor *)o;
  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) {
  struct __pyx_obj_3ode_AMotor *p = (struct __pyx_obj_3ode_AMotor *)o;
  __pyx_ptype_3ode_Joint->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_AMotor(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_AMotor *p = (struct __pyx_obj_3ode_AMotor *)o;
  __pyx_ptype_3ode_Joint->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_AMotor(PyObject *o) {
  struct __pyx_obj_3ode_AMotor *p = (struct __pyx_obj_3ode_AMotor *)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},
  {"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*/
};

statichere 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, /*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_SpaceBase(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_GeomObject->tp_new(t, a, k);
  struct __pyx_obj_3ode_SpaceBase *p = (struct __pyx_obj_3ode_SpaceBase *)o;
  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) {
  struct __pyx_obj_3ode_SpaceBase *p = (struct __pyx_obj_3ode_SpaceBase *)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;
  struct __pyx_obj_3ode_SpaceBase *p = (struct __pyx_obj_3ode_SpaceBase *)o;
  __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_SpaceBase(PyObject *o) {
  struct __pyx_obj_3ode_SpaceBase *p = (struct __pyx_obj_3ode_SpaceBase *)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 = {
  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_SpaceBase = {
  0, /*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*/
};

statichere 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, /*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*/
  0, /*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);
  struct __pyx_obj_3ode_SimpleSpace *p = (struct __pyx_obj_3ode_SimpleSpace *)o;
  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) {
  struct __pyx_obj_3ode_SimpleSpace *p = (struct __pyx_obj_3ode_SimpleSpace *)o;
  __pyx_ptype_3ode_SpaceBase->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_SimpleSpace(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_SimpleSpace *p = (struct __pyx_obj_3ode_SimpleSpace *)o;
  __pyx_ptype_3ode_SpaceBase->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_SimpleSpace(PyObject *o) {
  struct __pyx_obj_3ode_SimpleSpace *p = (struct __pyx_obj_3ode_SimpleSpace *)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*/
};

statichere 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, /*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);
  struct __pyx_obj_3ode_HashSpace *p = (struct __pyx_obj_3ode_HashSpace *)o;
  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) {
  struct __pyx_obj_3ode_HashSpace *p = (struct __pyx_obj_3ode_HashSpace *)o;
  __pyx_ptype_3ode_SpaceBase->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_HashSpace(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_HashSpace *p = (struct __pyx_obj_3ode_HashSpace *)o;
  __pyx_ptype_3ode_SpaceBase->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_HashSpace(PyObject *o) {
  struct __pyx_obj_3ode_HashSpace *p = (struct __pyx_obj_3ode_HashSpace *)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*/
};

statichere 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, /*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);
  struct __pyx_obj_3ode_QuadTreeSpace *p = (struct __pyx_obj_3ode_QuadTreeSpace *)o;
  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) {
  struct __pyx_obj_3ode_QuadTreeSpace *p = (struct __pyx_obj_3ode_QuadTreeSpace *)o;
  __pyx_ptype_3ode_SpaceBase->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_QuadTreeSpace(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_QuadTreeSpace *p = (struct __pyx_obj_3ode_QuadTreeSpace *)o;
  __pyx_ptype_3ode_SpaceBase->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_QuadTreeSpace(PyObject *o) {
  struct __pyx_obj_3ode_QuadTreeSpace *p = (struct __pyx_obj_3ode_QuadTreeSpace *)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*/
};

statichere 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, /*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);
  struct __pyx_obj_3ode_GeomSphere *p = (struct __pyx_obj_3ode_GeomSphere *)o;
  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) {
  struct __pyx_obj_3ode_GeomSphere *p = (struct __pyx_obj_3ode_GeomSphere *)o;
  __pyx_ptype_3ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_GeomSphere(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_GeomSphere *p = (struct __pyx_obj_3ode_GeomSphere *)o;
  __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_GeomSphere(PyObject *o) {
  struct __pyx_obj_3ode_GeomSphere *p = (struct __pyx_obj_3ode_GeomSphere *)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*/
};

statichere 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, /*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);
  struct __pyx_obj_3ode_GeomBox *p = (struct __pyx_obj_3ode_GeomBox *)o;
  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) {
  struct __pyx_obj_3ode_GeomBox *p = (struct __pyx_obj_3ode_GeomBox *)o;
  __pyx_ptype_3ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_GeomBox(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_GeomBox *p = (struct __pyx_obj_3ode_GeomBox *)o;
  __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_GeomBox(PyObject *o) {
  struct __pyx_obj_3ode_GeomBox *p = (struct __pyx_obj_3ode_GeomBox *)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*/
};

statichere 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, /*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);
  struct __pyx_obj_3ode_GeomPlane *p = (struct __pyx_obj_3ode_GeomPlane *)o;
  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) {
  struct __pyx_obj_3ode_GeomPlane *p = (struct __pyx_obj_3ode_GeomPlane *)o;
  __pyx_ptype_3ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_GeomPlane(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_GeomPlane *p = (struct __pyx_obj_3ode_GeomPlane *)o;
  __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_GeomPlane(PyObject *o) {
  struct __pyx_obj_3ode_GeomPlane *p = (struct __pyx_obj_3ode_GeomPlane *)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*/
};

statichere 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, /*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_GeomCCylinder(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_3ode_GeomObject->tp_new(t, a, k);
  struct __pyx_obj_3ode_GeomCCylinder *p = (struct __pyx_obj_3ode_GeomCCylinder *)o;
  if (__pyx_f_3ode_13GeomCCylinder___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3ode_GeomCCylinder(PyObject *o) {
  struct __pyx_obj_3ode_GeomCCylinder *p = (struct __pyx_obj_3ode_GeomCCylinder *)o;
  __pyx_ptype_3ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_GeomCCylinder(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_GeomCCylinder *p = (struct __pyx_obj_3ode_GeomCCylinder *)o;
  __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_GeomCCylinder(PyObject *o) {
  struct __pyx_obj_3ode_GeomCCylinder *p = (struct __pyx_obj_3ode_GeomCCylinder *)o;
  __pyx_ptype_3ode_GeomObject->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_3ode_GeomCCylinder[] = {
  {"placeable", (PyCFunction)__pyx_f_3ode_13GeomCCylinder_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {"_id", (PyCFunction)__pyx_f_3ode_13GeomCCylinder__id, METH_VARARGS|METH_KEYWORDS, 0},
  {"setParams", (PyCFunction)__pyx_f_3ode_13GeomCCylinder_setParams, METH_VARARGS|METH_KEYWORDS, 0},
  {"getParams", (PyCFunction)__pyx_f_3ode_13GeomCCylinder_getParams, METH_VARARGS|METH_KEYWORDS, 0},
  {"pointDepth", (PyCFunction)__pyx_f_3ode_13GeomCCylinder_pointDepth, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_13GeomCCylinder_pointDepth},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_GeomCCylinder = {
  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_GeomCCylinder = {
  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_GeomCCylinder = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_GeomCCylinder = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

statichere PyTypeObject __pyx_type_3ode_GeomCCylinder = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ode.GeomCCylinder", /*tp_name*/
  sizeof(struct __pyx_obj_3ode_GeomCCylinder), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ode_GeomCCylinder, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_GeomCCylinder, /*tp_as_number*/
  &__pyx_tp_as_sequence_GeomCCylinder, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_GeomCCylinder, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_GeomCCylinder, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*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      GeomCCylinder(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_GeomCCylinder, /*tp_traverse*/
  __pyx_tp_clear_3ode_GeomCCylinder, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ode_GeomCCylinder, /*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_13GeomCCylinder___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ode_GeomCCylinder, /*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);
  struct __pyx_obj_3ode_GeomRay *p = (struct __pyx_obj_3ode_GeomRay *)o;
  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) {
  struct __pyx_obj_3ode_GeomRay *p = (struct __pyx_obj_3ode_GeomRay *)o;
  __pyx_ptype_3ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_3ode_GeomRay(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3ode_GeomRay *p = (struct __pyx_obj_3ode_GeomRay *)o;
  __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a);
  return 0;
}

static int __pyx_tp_clear_3ode_GeomRay(PyObject *o) {
  struct __pyx_obj_3ode_GeomRay *p = (struct __pyx_obj_3ode_GeomRay *)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*/
};

statichere 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, /*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(p->geom);
  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;
  __pyx_ptype_3ode_GeomObject->tp_traverse(o, v, a);
  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(p->geom);
  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*/
};

statichere 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 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},
  {"CloseODE", (PyCFunction)__pyx_f_3ode_CloseODE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ode_CloseODE},
  {0, 0, 0, 0}
};

DL_EXPORT(void) initode(void); /*proto*/
DL_EXPORT(void) 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;
  __pyx_m = Py_InitModule4("ode", __pyx_methods, 0, 0, PYTHON_API_VERSION);
  if (!__pyx_m) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 14; goto __pyx_L1;};
  __pyx_b = PyImport_AddModule("__builtin__");
  if (!__pyx_b) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 14; goto __pyx_L1;};
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 14; goto __pyx_L1;};
  if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 14; goto __pyx_L1;};
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 14; goto __pyx_L1;};
  __pyx_type_3ode_GeomObject.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_3ode_GeomObject) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 18; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomObject", (PyObject *)&__pyx_type_3ode_GeomObject) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 18; goto __pyx_L1;}
  __pyx_ptype_3ode_GeomObject = &__pyx_type_3ode_GeomObject;
  __pyx_type_3ode_GeomLand.tp_base = __pyx_ptype_3ode_GeomObject;
  if (PyType_Ready(&__pyx_type_3ode_GeomLand) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 152; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomLand", (PyObject *)&__pyx_type_3ode_GeomLand) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 152; goto __pyx_L1;}
  __pyx_ptype_3ode_GeomLand = &__pyx_type_3ode_GeomLand;
  if (PyType_Ready(&__pyx_type_3ode_Mass) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Mass", (PyObject *)&__pyx_type_3ode_Mass) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; 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 = 3; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Contact", (PyObject *)&__pyx_type_3ode_Contact) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; 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 = 3; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "World", (PyObject *)&__pyx_type_3ode_World) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; 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 = 3; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Body", (PyObject *)&__pyx_type_3ode_Body) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; 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 = 18; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "JointGroup", (PyObject *)&__pyx_type_3ode_JointGroup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 18; 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 = 72; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Joint", (PyObject *)&__pyx_type_3ode_Joint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 72; 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 = 207; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "BallJoint", (PyObject *)&__pyx_type_3ode_BallJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 207; 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 = 279; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "HingeJoint", (PyObject *)&__pyx_type_3ode_HingeJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 279; 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 = 422; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "SliderJoint", (PyObject *)&__pyx_type_3ode_SliderJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 422; 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 = 497; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "UniversalJoint", (PyObject *)&__pyx_type_3ode_UniversalJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 497; 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 = 611; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Hinge2Joint", (PyObject *)&__pyx_type_3ode_Hinge2Joint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 611; 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 = 754; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "FixedJoint", (PyObject *)&__pyx_type_3ode_FixedJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 754; 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 = 789; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "ContactJoint", (PyObject *)&__pyx_type_3ode_ContactJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 789; 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 = 812; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "AMotor", (PyObject *)&__pyx_type_3ode_AMotor) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 812; goto __pyx_L1;}
  __pyx_ptype_3ode_AMotor = &__pyx_type_3ode_AMotor;
  __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 = 2; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "SpaceBase", (PyObject *)&__pyx_type_3ode_SpaceBase) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 2; 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 = 169; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "SimpleSpace", (PyObject *)&__pyx_type_3ode_SimpleSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 169; 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 = 202; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "HashSpace", (PyObject *)&__pyx_type_3ode_HashSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 202; 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 = 262; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "QuadTreeSpace", (PyObject *)&__pyx_type_3ode_QuadTreeSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 262; 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 = 4; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomSphere", (PyObject *)&__pyx_type_3ode_GeomSphere) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; 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 = 73; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomBox", (PyObject *)&__pyx_type_3ode_GeomBox) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 73; 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 = 132; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomPlane", (PyObject *)&__pyx_type_3ode_GeomPlane) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 132; goto __pyx_L1;}
  __pyx_ptype_3ode_GeomPlane = &__pyx_type_3ode_GeomPlane;
  __pyx_type_3ode_GeomCCylinder.tp_base = __pyx_ptype_3ode_GeomObject;
  if (PyType_Ready(&__pyx_type_3ode_GeomCCylinder) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 194; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomCCylinder", (PyObject *)&__pyx_type_3ode_GeomCCylinder) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 194; goto __pyx_L1;}
  __pyx_ptype_3ode_GeomCCylinder = &__pyx_type_3ode_GeomCCylinder;
  __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 = 256; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomRay", (PyObject *)&__pyx_type_3ode_GeomRay) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 256; 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 = 311; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomTransform", (PyObject *)&__pyx_type_3ode_GeomTransform) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 311; goto __pyx_L1;}
  __pyx_ptype_3ode_GeomTransform = &__pyx_type_3ode_GeomTransform;

  /* "/home/jiba/src/soya/ode/ode.pyx":25 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n___doc__, __pyx_k1p) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 25; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/ode.pyx":70 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramLoStop, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":71 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 71; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramHiStop, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 71; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":72 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 72; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramVel, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 72; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":73 */
  __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 73; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramFMax, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 73; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":74 */
  __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 74; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramFudgeFactor, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 74; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":75 */
  __pyx_1 = PyInt_FromLong(5); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 75; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramBounce, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 75; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":76 */
  __pyx_1 = PyInt_FromLong(6); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 76; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramCFM, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 76; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":77 */
  __pyx_1 = PyInt_FromLong(7); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 77; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramStopERP, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 77; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":78 */
  __pyx_1 = PyInt_FromLong(8); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 78; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramStopCFM, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 78; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":79 */
  __pyx_1 = PyInt_FromLong(9); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 79; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramSuspensionERP, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 79; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":80 */
  __pyx_1 = PyInt_FromLong(10); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 80; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_paramSuspensionCFM, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 80; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":82 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 82; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamLoStop, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 82; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":83 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 83; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamHiStop, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 83; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":84 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 84; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamVel, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 84; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":85 */
  __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamFMax, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":86 */
  __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 86; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamFudgeFactor, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 86; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":87 */
  __pyx_1 = PyInt_FromLong(5); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 87; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamBounce, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 87; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":88 */
  __pyx_1 = PyInt_FromLong(6); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 88; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamCFM, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 88; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":89 */
  __pyx_1 = PyInt_FromLong(7); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 89; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamStopERP, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 89; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":90 */
  __pyx_1 = PyInt_FromLong(8); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 90; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamStopCFM, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 90; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":91 */
  __pyx_1 = PyInt_FromLong(9); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 91; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamSuspensionERP, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 91; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":92 */
  __pyx_1 = PyInt_FromLong(10); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamSuspensionCFM, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":94 */
  __pyx_1 = PyInt_FromLong((256 + 0)); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 94; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamLoStop2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 94; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":95 */
  __pyx_1 = PyInt_FromLong((256 + 1)); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 95; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamHiStop2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 95; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":96 */
  __pyx_1 = PyInt_FromLong((256 + 2)); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 96; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamVel2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 96; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":97 */
  __pyx_1 = PyInt_FromLong((256 + 3)); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 97; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamFMax2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 97; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":98 */
  __pyx_1 = PyInt_FromLong((256 + 4)); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 98; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamFudgeFactor2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 98; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":99 */
  __pyx_1 = PyInt_FromLong((256 + 5)); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 99; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamBounce2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 99; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":100 */
  __pyx_1 = PyInt_FromLong((256 + 6)); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 100; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamCFM2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 100; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":101 */
  __pyx_1 = PyInt_FromLong((256 + 7)); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 101; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamStopERP2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 101; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":102 */
  __pyx_1 = PyInt_FromLong((256 + 8)); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamStopCFM2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":103 */
  __pyx_1 = PyInt_FromLong((256 + 9)); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 103; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamSuspensionERP2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 103; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":104 */
  __pyx_1 = PyInt_FromLong((256 + 10)); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 104; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ParamSuspensionCFM2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 104; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":106 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 106; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactMu2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 106; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":107 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 107; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactFDir1, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 107; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":108 */
  __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 108; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactBounce, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 108; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":109 */
  __pyx_1 = PyInt_FromLong(8); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 109; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactSoftERP, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 109; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":110 */
  __pyx_1 = PyInt_FromLong(16); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 110; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactSoftCFM, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":111 */
  __pyx_1 = PyInt_FromLong(32); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 111; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactMotion1, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 111; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":112 */
  __pyx_1 = PyInt_FromLong(64); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 112; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactMotion2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 112; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":113 */
  __pyx_1 = PyInt_FromLong(128); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 113; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactSlip1, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 113; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":114 */
  __pyx_1 = PyInt_FromLong(256); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 114; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactSlip2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 114; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":116 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 116; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactApprox0, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 116; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":117 */
  __pyx_1 = PyInt_FromLong(4096); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 117; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactApprox1_1, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 117; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":118 */
  __pyx_1 = PyInt_FromLong(8192); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 118; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactApprox1_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 118; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":119 */
  __pyx_1 = PyInt_FromLong(12288); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 119; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ContactApprox1, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 119; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":121 */
  __pyx_1 = PyInt_FromLong(dAMotorUser); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 121; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_AMotorUser, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 121; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":122 */
  __pyx_1 = PyInt_FromLong(dAMotorEuler); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 122; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_AMotorEuler, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 122; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":124 */
  __pyx_1 = PyFloat_FromDouble(dInfinity); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 124; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_Infinity, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 124; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/ode.pyx":129 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 129; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n__geom_c2py_lut, __pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 129; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/contact.pyx":113 */
  Py_INCREF(Py_None);
  __pyx_k2 = Py_None;
  Py_INCREF(Py_None);
  __pyx_k3 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":151 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 151; goto __pyx_L1;}
  __pyx_k4 = __pyx_1;
  __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/joints.pyx":215 */
  Py_INCREF(Py_None);
  __pyx_k5 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":225 */
  Py_INCREF(Py_None);
  __pyx_k6 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":287 */
  Py_INCREF(Py_None);
  __pyx_k7 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":297 */
  Py_INCREF(Py_None);
  __pyx_k8 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":430 */
  Py_INCREF(Py_None);
  __pyx_k9 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":440 */
  Py_INCREF(Py_None);
  __pyx_k10 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":505 */
  Py_INCREF(Py_None);
  __pyx_k11 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":515 */
  Py_INCREF(Py_None);
  __pyx_k12 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":619 */
  Py_INCREF(Py_None);
  __pyx_k13 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":629 */
  Py_INCREF(Py_None);
  __pyx_k14 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":762 */
  Py_INCREF(Py_None);
  __pyx_k15 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":772 */
  Py_INCREF(Py_None);
  __pyx_k16 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":820 */
  Py_INCREF(Py_None);
  __pyx_k17 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":830 */
  Py_INCREF(Py_None);
  __pyx_k18 = Py_None;

  /* "/home/jiba/src/soya/ode/space.pyx":181 */
  Py_INCREF(Py_None);
  __pyx_k19 = Py_None;

  /* "/home/jiba/src/soya/ode/space.pyx":198 */
  Py_INCREF(Py_None);
  __pyx_k20 = Py_None;

  /* "/home/jiba/src/soya/ode/space.pyx":214 */
  Py_INCREF(Py_None);
  __pyx_k21 = Py_None;

  /* "/home/jiba/src/soya/ode/space.pyx":231 */
  Py_INCREF(Py_None);
  __pyx_k22 = Py_None;

  /* "/home/jiba/src/soya/ode/space.pyx":273 */
  Py_INCREF(Py_None);
  __pyx_k23 = Py_None;

  /* "/home/jiba/src/soya/ode/space.pyx":298 */
  Py_INCREF(Py_None);
  __pyx_k24 = Py_None;

  /* "/home/jiba/src/soya/ode/space.pyx":302 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 302; goto __pyx_L1;}
  __pyx_k25 = __pyx_2;
  __pyx_2 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":14 */
  Py_INCREF(Py_None);
  __pyx_k26 = Py_None;
  __pyx_3 = PyFloat_FromDouble(1.0); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 14; goto __pyx_L1;}
  __pyx_k27 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":29 */
  Py_INCREF(Py_None);
  __pyx_k28 = Py_None;
  __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 29; goto __pyx_L1;}
  __pyx_k29 = __pyx_4;
  __pyx_4 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":83 */
  Py_INCREF(Py_None);
  __pyx_k30 = Py_None;
  __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 83; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 83; goto __pyx_L1;}
  __pyx_7 = PyFloat_FromDouble(1.0); if (!__pyx_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 83; goto __pyx_L1;}
  __pyx_8 = PyTuple_New(3); if (!__pyx_8) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 83; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_8, 0, __pyx_5);
  PyTuple_SET_ITEM(__pyx_8, 1, __pyx_6);
  PyTuple_SET_ITEM(__pyx_8, 2, __pyx_7);
  __pyx_5 = 0;
  __pyx_6 = 0;
  __pyx_7 = 0;
  __pyx_k31 = __pyx_8;
  __pyx_8 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":97 */
  Py_INCREF(Py_None);
  __pyx_k32 = Py_None;
  __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 97; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 97; goto __pyx_L1;}
  __pyx_7 = PyFloat_FromDouble(1.0); if (!__pyx_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 97; goto __pyx_L1;}
  __pyx_9 = PyTuple_New(3); if (!__pyx_9) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 97; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_9, 0, __pyx_5);
  PyTuple_SET_ITEM(__pyx_9, 1, __pyx_6);
  PyTuple_SET_ITEM(__pyx_9, 2, __pyx_7);
  __pyx_5 = 0;
  __pyx_6 = 0;
  __pyx_7 = 0;
  __pyx_k33 = __pyx_9;
  __pyx_9 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":147 */
  Py_INCREF(Py_None);
  __pyx_k34 = Py_None;
  __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  __pyx_7 = PyInt_FromLong(1); if (!__pyx_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  __pyx_10 = PyTuple_New(3); if (!__pyx_10) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_10, 0, __pyx_5);
  PyTuple_SET_ITEM(__pyx_10, 1, __pyx_6);
  PyTuple_SET_ITEM(__pyx_10, 2, __pyx_7);
  __pyx_5 = 0;
  __pyx_6 = 0;
  __pyx_7 = 0;
  __pyx_k35 = __pyx_10;
  __pyx_10 = 0;
  __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  __pyx_k36 = __pyx_5;
  __pyx_5 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":162 */
  Py_INCREF(Py_None);
  __pyx_k37 = Py_None;
  __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 162; goto __pyx_L1;}
  __pyx_7 = PyInt_FromLong(0); if (!__pyx_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 162; goto __pyx_L1;}
  __pyx_11 = PyInt_FromLong(1); if (!__pyx_11) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 162; goto __pyx_L1;}
  __pyx_12 = PyTuple_New(3); if (!__pyx_12) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 162; 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_k38 = __pyx_12;
  __pyx_12 = 0;
  __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 162; goto __pyx_L1;}
  __pyx_k39 = __pyx_6;
  __pyx_6 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":207 */
  Py_INCREF(Py_None);
  __pyx_k40 = Py_None;
  __pyx_7 = PyFloat_FromDouble(0.5); if (!__pyx_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 207; goto __pyx_L1;}
  __pyx_k41 = __pyx_7;
  __pyx_7 = 0;
  __pyx_11 = PyFloat_FromDouble(1.0); if (!__pyx_11) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 207; goto __pyx_L1;}
  __pyx_k42 = __pyx_11;
  __pyx_11 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":221 */
  Py_INCREF(Py_None);
  __pyx_k43 = Py_None;
  __pyx_13 = PyFloat_FromDouble(0.5); if (!__pyx_13) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 221; goto __pyx_L1;}
  __pyx_k44 = __pyx_13;
  __pyx_13 = 0;
  __pyx_14 = PyFloat_FromDouble(1.0); if (!__pyx_14) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 221; goto __pyx_L1;}
  __pyx_k45 = __pyx_14;
  __pyx_14 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":270 */
  Py_INCREF(Py_None);
  __pyx_k46 = Py_None;
  __pyx_15 = PyFloat_FromDouble(1.0); if (!__pyx_15) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 270; goto __pyx_L1;}
  __pyx_k47 = __pyx_15;
  __pyx_15 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":285 */
  Py_INCREF(Py_None);
  __pyx_k48 = Py_None;
  __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 285; goto __pyx_L1;}
  __pyx_k49 = __pyx_16;
  __pyx_16 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":325 */
  Py_INCREF(Py_None);
  __pyx_k50 = Py_None;

  /* "/home/jiba/src/soya/ode/geoms.pyx":342 */
  Py_INCREF(Py_None);
  __pyx_k51 = Py_None;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":142 */
  __pyx_v_3ode_dLandGeomClass.bytes = 0;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":143 */
  __pyx_v_3ode_dLandGeomClass.collider = __pyx_f_3ode_LandGetColliderFn;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":144 */
  __pyx_v_3ode_dLandGeomClass.aabb = __pyx_f_3ode_LandGetAABB;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":145 */
  __pyx_v_3ode_dLandGeomClass.aabb_test = 0;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":146 */
  __pyx_v_3ode_dLandGeomClass.dtor = 0;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":150 */
  __pyx_v_3ode_dLandClass = dCreateGeomClass((&__pyx_v_3ode_dLandGeomClass));

  /* "/home/jiba/src/soya/ode/landgeom.pyx":153 */
  Py_INCREF(Py_None);
  __pyx_k52 = Py_None;

  /* "/home/jiba/src/soya/ode/landgeom.pyx":177 */
  Py_INCREF(Py_None);
  __pyx_k53 = Py_None;

  /* "/home/jiba/src/soya/ode/ode.pyx":213 */
  __pyx_17 = PyTuple_New(1); if (!__pyx_17) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 213; goto __pyx_L1;}
  Py_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_17, 0, Py_None);
  __pyx_18 = PyObject_CallObject(((PyObject*)__pyx_ptype_3ode_Body), __pyx_17); if (!__pyx_18) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 213; goto __pyx_L1;}
  Py_DECREF(__pyx_17); __pyx_17 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_environment, __pyx_18) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 213; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;
  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);
  __Pyx_AddTraceback("ode");
}

static char *__pyx_filenames[] = {
  "mass.pyx",
  "contact.pyx",
  "world.pyx",
  "body.pyx",
  "joints.pyx",
  "geomobject.pyx",
  "space.pyx",
  "geoms.pyx",
  "landgeom.pyx",
  "ode.pyx",
};
statichere char **__pyx_f = __pyx_filenames;

/* Runtime support code */

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_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))
        ;
    else if (PyClass_Check(type))
        ; /*PyErr_NormalizeException(&type, &value, &tb);*/
    else if (PyInstance_Check(type)) {
        /* 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;
        }
        else {
            /* Normalize to raise <class>, <instance> */
            Py_DECREF(value);
            value = type;
            type = (PyObject*) ((PyInstanceObject*)type)->in_class;
            Py_INCREF(type);
        }
    }
    else {
        /* Not something you can raise.  You get an exception
           anyway, just not what you specified :-) */
        PyErr_Format(PyExc_TypeError,
                 "exceptions must be strings, classes, or "
                 "instances, not %s", type->ob_type->tp_name);
        goto raise_error;
    }
    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 *seq, int i) {
  PyObject *item;
  if (!(item = PySequence_GetItem(seq, i))) {
    if (PyErr_ExceptionMatches(PyExc_IndexError))
    	__Pyx_UnpackError();
  }
  return item;
}

static int __Pyx_EndUnpack(PyObject *seq, int i) {
  PyObject *item;
  if (item = PySequence_GetItem(seq, i)) {
    Py_DECREF(item);
    __Pyx_UnpackError();
    return -1;
  }
  PyErr_Clear();
    return 0;
}

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 PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject("stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}

static int __Pyx_PrintItem(PyObject *v) {
    PyObject *f;
    
    if (!(f = __Pyx_GetStdout()))
        return -1;
    if (PyFile_SoftSpace(f, 1)) {
        if (PyFile_WriteString(" ", f) < 0)
            return -1;
    }
    if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
        return -1;
    if (PyString_Check(v)) {
        char *s = PyString_AsString(v);
        int len = PyString_Size(v);
        if (len > 0 &&
            isspace(Py_CHARMASK(s[len-1])) &&
            s[len-1] != ' ')
                PyFile_SoftSpace(f, 0);
    }
    return 0;
}

static int __Pyx_PrintNewline(void) {
    PyObject *f;
    
    if (!(f = __Pyx_GetStdout()))
        return -1;
    if (PyFile_WriteString("\n", f) < 0)
        return -1;
    PyFile_SoftSpace(f, 0);
    return 0;
}

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);
}
