/* Generated by Pyrex 0.9.3.1 on Tue Jul 18 22:16:54 2006 */

#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#include "stdlib.h"
#include "string.h"
#include "math.h"
#include "stdint.h"
#include "GL/glew.h"
#include "ode/ode.h"
#include "SDL/SDL_endian.h"
#include "SDL/SDL.h"
#include "chunk.h"
#include "matrix.h"
#include "cal3d_wrapper.h"
#include "freetype_include.h"
#include "AL/al.h"
#include "AL/alc.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 _soya */

typedef struct {
  void (*content);
  int nb;
  int max;
} __pyx_t_5_soya_Chunk;

enum  {
  __pyx_e_5_soya_QUALITY_LOW = 0,
  __pyx_e_5_soya_QUALITY_MEDIUM = 1,
  __pyx_e_5_soya_QUALITY_HIGH = 2,
};

enum  {
  __pyx_e_5_soya_INITED = (1 << 0),
  __pyx_e_5_soya_USE_MIPMAP = (1 << 1),
  __pyx_e_5_soya_FULLSCREEN = (1 << 2),
  __pyx_e_5_soya_WIREFRAME = (1 << 3),
  __pyx_e_5_soya_FX_INITED = (1 << 4),
  __pyx_e_5_soya_SHADOWS = (1 << 5),
  __pyx_e_5_soya_HAS_STENCIL = (1 << 6),
};

enum  {
  __pyx_e_5_soya_MATERIAL_SEPARATE_SPECULAR = (1 << 1),
  __pyx_e_5_soya_MATERIAL_ADDITIVE_BLENDING = (1 << 2),
  __pyx_e_5_soya_MATERIAL_ALPHA = (1 << 3),
  __pyx_e_5_soya_MATERIAL_MASK = (1 << 4),
  __pyx_e_5_soya_MATERIAL_CLAMP = (1 << 5),
  __pyx_e_5_soya_MATERIAL_ENVIRONMENT_MAPPING = (1 << 6),
  __pyx_e_5_soya_MATERIAL_MIPMAP = (1 << 7),
  __pyx_e_5_soya_MATERIAL_BORDER = (1 << 8),
  __pyx_e_5_soya_MATERIAL_EMULATE_BORDER = (1 << 9),
};

enum  {
  __pyx_e_5_soya_VERTEX_ALPHA = (1 << 1),
  __pyx_e_5_soya_VERTEX_MADE = (1 << 3),
  __pyx_e_5_soya_VERTEX_INVISIBLE = (1 << 4),
  __pyx_e_5_soya_VERTEX_FX_TRANSITION = (1 << 5),
};

enum  {
  __pyx_e_5_soya_FACE_TRIANGLE = (1 << 0),
  __pyx_e_5_soya_FACE_QUAD = (1 << 1),
  __pyx_e_5_soya_FACE_NON_SOLID = (1 << 2),
  __pyx_e_5_soya_FACE_HIDDEN = (1 << 3),
  __pyx_e_5_soya_FACE_ALPHA = (1 << 4),
  __pyx_e_5_soya_FACE_DOUBLE_SIDED = (1 << 5),
  __pyx_e_5_soya_FACE_SMOOTH_LIT = (1 << 6),
  __pyx_e_5_soya_FACE_FRONT = (1 << 7),
  __pyx_e_5_soya_FACE_BACK = (1 << 8),
  __pyx_e_5_soya_FACE_NO_VERTEX_NORMAL_INFLUENCE = (1 << 9),
  __pyx_e_5_soya_FACE_NON_LIT = (1 << 10),
  __pyx_e_5_soya_FACE_STATIC_LIT = (1 << 11),
  __pyx_e_5_soya_FACE_LIGHT_FRONT = (1 << 12),
  __pyx_e_5_soya_FACE_LIGHT_BACK = (1 << 13),
};

enum  {
  __pyx_e_5_soya_PACK_SECONDPASS = (1 << 2),
  __pyx_e_5_soya_PACK_SPECIAL = (1 << 3),
};

enum  {
  __pyx_e_5_soya_HIDDEN = (1 << 0),
  __pyx_e_5_soya_LEFTHANDED = (1 << 3),
  __pyx_e_5_soya_NON_SOLID = (1 << 4),
  __pyx_e_5_soya_WORLD_BATCHED = (1 << 6),
  __pyx_e_5_soya_BONUS_BATCHED = (1 << 6),
  __pyx_e_5_soya_WORLD_PORTAL_LINKED = (1 << 7),
  __pyx_e_5_soya_LIGHT_TOP_LEVEL = (1 << 7),
  __pyx_e_5_soya_LIGHT_DIRECTIONAL = (1 << 8),
  __pyx_e_5_soya_LIGHT_NO_SHADOW = (1 << 9),
  __pyx_e_5_soya_LIGHT_SHADOW_COLOR = (1 << 10),
  __pyx_e_5_soya_LIGHT_STATIC = (1 << 11),
  __pyx_e_5_soya_LIGHT_INVALID = (1 << 6),
  __pyx_e_5_soya_CAMERA_PARTIAL = (1 << 5),
  __pyx_e_5_soya_CAMERA_ORTHO = (1 << 6),
  __pyx_e_5_soya_CAMERA_NO_LISTENER = (1 << 7),
  __pyx_e_5_soya_SOUND_PLAY_IN_3D = (1 << 6),
  __pyx_e_5_soya_SOUND_AUTO_REMOVE = (1 << 7),
  __pyx_e_5_soya_SOUND_LOOP = (1 << 8),
  __pyx_e_5_soya_FACE2_LIT = (1 << 12),
  __pyx_e_5_soya_FACE2_SMOOTH_LIT = (1 << 13),
  __pyx_e_5_soya_FACE2_STATIC_LIT = (1 << 14),
  __pyx_e_5_soya_FACE2_DOUBLE_SIDED = (1 << 15),
  __pyx_e_5_soya_COORDSYST_STATE_VALID = (1 << 16),
};

enum  {
  __pyx_e_5_soya_PORTAL_USE_4_CLIP_PLANES = (1 << 5),
  __pyx_e_5_soya_PORTAL_USE_5_CLIP_PLANES = (1 << 6),
  __pyx_e_5_soya_PORTAL_BOUND_ATMOSPHERE = (1 << 8),
  __pyx_e_5_soya_PORTAL_TELEPORTER = (1 << 9),
};

enum  {
  __pyx_e_5_soya_RAYPICK_CULL_FACE = (1 << 0),
  __pyx_e_5_soya_RAYPICK_HALF_LINE = (1 << 1),
};

enum  {
  __pyx_e_5_soya_RAYPICK_DIRECT = 1,
  __pyx_e_5_soya_RAYPICK_INDIRECT = 2,
};

enum  {
  __pyx_e_5_soya_COORDSYS_INVALID = 0,
  __pyx_e_5_soya_COORDSYS_ROOT_VALID = (1 << 0),
  __pyx_e_5_soya_COORDSYS_INVERTED_ROOT_VALID = (1 << 1),
  __pyx_e_5_soya_COORDSYS_STATIC = (1 << 19),
  __pyx_e_5_soya_COORDSYS_NON_AUTO_STATIC = (1 << 20),
};

enum  {
  __pyx_e_5_soya_RENDERER_STATE_OPAQUE = 0,
  __pyx_e_5_soya_RENDERER_STATE_SECONDPASS = 1,
  __pyx_e_5_soya_RENDERER_STATE_ALPHA = 2,
  __pyx_e_5_soya_RENDERER_STATE_SPECIAL = 3,
};

enum  {
  __pyx_e_5_soya_PACK_OPTIONS = ((((__pyx_e_5_soya_FACE_TRIANGLE | __pyx_e_5_soya_FACE_QUAD) | __pyx_e_5_soya_FACE_ALPHA) | __pyx_e_5_soya_FACE_DOUBLE_SIDED) | __pyx_e_5_soya_FACE_NON_LIT),
  __pyx_e_5_soya_DISPLAY_LIST_OPTIONS = ((((__pyx_e_5_soya_FACE_TRIANGLE | __pyx_e_5_soya_FACE_QUAD) | __pyx_e_5_soya_FACE_ALPHA) | __pyx_e_5_soya_FACE_DOUBLE_SIDED) | __pyx_e_5_soya_FACE_NON_LIT),
};

enum  {
  __pyx_e_5_soya_MODEL_DIFFUSES = (1 << 5),
  __pyx_e_5_soya_MODEL_EMISSIVES = (1 << 6),
  __pyx_e_5_soya_MODEL_TEXCOORDS = (1 << 8),
  __pyx_e_5_soya_MODEL_VERTEX_OPTIONS = (1 << 10),
  __pyx_e_5_soya_MODEL_CELLSHADING = (1 << 11),
  __pyx_e_5_soya_MODEL_NEVER_LIT = (1 << 12),
  __pyx_e_5_soya_MODEL_PLANE_EQUATION = (1 << 14),
  __pyx_e_5_soya_MODEL_NEIGHBORS = (1 << 15),
  __pyx_e_5_soya_MODEL_INITED = (1 << 16),
  __pyx_e_5_soya_MODEL_TREE = (1 << 17),
  __pyx_e_5_soya_MODEL_DISPLAY_LISTS = (1 << 18),
  __pyx_e_5_soya_MODEL_FACE_LIST = (1 << 19),
  __pyx_e_5_soya_MODEL_HAS_SPHERE = (1 << 20),
  __pyx_e_5_soya_MODEL_SHADOW = (1 << 21),
  __pyx_e_5_soya_MODEL_STATIC_SHADOW = (1 << 22),
  __pyx_e_5_soya_MODEL_STATIC_LIT = (1 << 23),
  __pyx_e_5_soya_MODEL_SIMPLE_NEIGHBORS = (1 << 24),
  __pyx_e_5_soya_MODEL_SHARED_DATA = (1 << 25),
};

enum  {
  __pyx_e_5_soya_TEXT_ALIGN_LEFT = 0,
  __pyx_e_5_soya_TEXT_ALIGN_CENTER = 1,
};

enum  {
  __pyx_e_5_soya_FONT_RASTER = 1,
  __pyx_e_5_soya_FONT_TEXTURE = 2,
};

enum  {
  __pyx_e_5_soya_ATMOSPHERE_FOG = (1 << 3),
  __pyx_e_5_soya_ATMOSPHERE_SKY_BOX_ALPHA = (1 << 7),
  __pyx_e_5_soya_ATMOSPHERE_HAS_CHILD = (1 << 8),
};

enum  {
  __pyx_e_5_soya_SPRITE_ALPHA = (1 << 7),
  __pyx_e_5_soya_SPRITE_COLORED = (1 << 9),
  __pyx_e_5_soya_SPRITE_NEVER_LIT = (1 << 11),
  __pyx_e_5_soya_SPRITE_RECEIVE_SHADOW = (1 << 12),
};

enum  {
  __pyx_e_5_soya_PARTICLES_MULTI_COLOR = (1 << 14),
  __pyx_e_5_soya_PARTICLES_MULTI_SIZE = (1 << 15),
  __pyx_e_5_soya_PARTICLES_CYLINDER = (1 << 16),
  __pyx_e_5_soya_PARTICLES_AUTO_GENERATE = (1 << 17),
  __pyx_e_5_soya_PARTICLES_REMOVABLE = (1 << 18),
};

enum  {
  __pyx_e_5_soya_TERRAIN_INITED = (1 << 2),
  __pyx_e_5_soya_TERRAIN_REAL_LOD_RAYPICK = (1 << 3),
  __pyx_e_5_soya_TERRAIN_VERTEX_OPTIONS = (1 << 7),
  __pyx_e_5_soya_TERRAIN_COLORED = (1 << 8),
};

enum  {
  __pyx_e_5_soya_TERRAIN_VERTEX_HIDDEN = (1 << 0),
  __pyx_e_5_soya_TERRAIN_VERTEX_ALPHA = __pyx_e_5_soya_VERTEX_ALPHA,
  __pyx_e_5_soya_TERRAIN_VERTEX_NON_SOLID = (1 << 2),
  __pyx_e_5_soya_TERRAIN_VERTEX_FORCE_PRESENCE = (1 << 3),
};

enum  {
  __pyx_e_5_soya_CAL3D_ALPHA = (1 << 5),
  __pyx_e_5_soya_CAL3D_CELL_SHADING = (1 << 6),
  __pyx_e_5_soya_CAL3D_SHADOW = (1 << 7),
  __pyx_e_5_soya_CAL3D_NEIGHBORS = (1 << 8),
  __pyx_e_5_soya_CAL3D_INITED = (1 << 9),
  __pyx_e_5_soya_CAL3D_DOUBLE_SIDED = (1 << 10),
};

typedef struct {
  float (position[3]);
  float (points[24]);
  float (planes[24]);
} __pyx_t_5_soya_Frustum;

struct __pyx_t_5_soya__Pack {
  int option;
  intptr_t material_id;
  struct __pyx_t_5_soya__Pack (*alpha);
  struct __pyx_t_5_soya__Pack (*secondpass);
  __pyx_t_5_soya_Chunk (*batched_faces);
};

typedef struct {
  int option;
  int id;
  intptr_t material_id;
  int (*faces_id);
  __pyx_t_5_soya_Chunk (*chunk);
} __pyx_t_5_soya_DisplayList;

typedef struct {
  int nb_opaque_list;
  int nb_alpha_list;
  __pyx_t_5_soya_DisplayList (*display_lists);
} __pyx_t_5_soya_DisplayLists;

typedef struct {
  int option;
  struct __pyx_t_5_soya__Pack (*pack);
  int normal;
  int (v[4]);
} __pyx_t_5_soya_ModelFace;

struct __pyx_t_5_soya__Node {
  int nb_faces;
  int nb_children;
  int (*faces);
  struct __pyx_t_5_soya__Node (*(*children));
  float (sphere[4]);
};

typedef struct {
  float (texcoord[2]);
  float (normal[3]);
  float (coord[3]);
  struct __pyx_t_5_soya__Pack (*pack);
} __pyx_t_5_soya_TerrainVertex;

struct __pyx_t_5_soya__TerrainTri {
  char level;
  float (normal[3]);
  float (sphere[4]);
  __pyx_t_5_soya_TerrainVertex (*v1);
  __pyx_t_5_soya_TerrainVertex (*v2);
  __pyx_t_5_soya_TerrainVertex (*v3);
  struct __pyx_t_5_soya__TerrainTri (*parent);
  struct __pyx_t_5_soya__TerrainTri (*left_child);
  struct __pyx_t_5_soya__TerrainTri (*right_child);
  struct __pyx_t_5_soya__TerrainTri (*left_neighbor);
  struct __pyx_t_5_soya__TerrainTri (*right_neighbor);
  struct __pyx_t_5_soya__TerrainTri (*base_neighbor);
  struct __pyx_t_5_soya__Pack (*pack);
  struct __pyx_t_5_soya__TerrainPatch (*patch);
  int texcoord_type;
};

struct __pyx_t_5_soya__TerrainPatch {
  float (sphere[4]);
  char level;
  struct __pyx_t_5_soya__TerrainTri (*tri_top);
  struct __pyx_t_5_soya__TerrainTri (*tri_left);
  struct __pyx_t_5_soya__TerrainTri (*tri_right);
  struct __pyx_t_5_soya__TerrainTri (*tri_bottom);
  int visible;
};


struct __pyx_obj_5_soya__CObj {
  PyObject_HEAD
  struct __pyx_vtabstruct_5_soya__CObj *__pyx_vtab;
};

struct __pyx_vtabstruct_5_soya__CObj {
  PyObject *((*__getcstate__)(struct __pyx_obj_5_soya__CObj *));
  void ((*__setcstate__)(struct __pyx_obj_5_soya__CObj *,PyObject *));
};
static struct __pyx_vtabstruct_5_soya__CObj *__pyx_vtabptr_5_soya__CObj;


struct __pyx_obj_5_soya__Image {
  struct __pyx_obj_5_soya__CObj __pyx_base;
  int nb_color;
  int width;
  int height;
  GLubyte (*_pixels);
  PyObject *_filename;
};

struct __pyx_vtabstruct_5_soya__Image {
  struct __pyx_vtabstruct_5_soya__CObj __pyx_base;
  int ((*check_for_gl)(struct __pyx_obj_5_soya__Image *));
  GLuint ((*typ)(struct __pyx_obj_5_soya__Image *));
  GLuint ((*internal_format)(struct __pyx_obj_5_soya__Image *));
};
static struct __pyx_vtabstruct_5_soya__Image *__pyx_vtabptr_5_soya__Image;


struct __pyx_obj_5_soya__Material {
  struct __pyx_obj_5_soya__CObj __pyx_base;
  int _option;
  int _nb_packs;
  struct __pyx_obj_5_soya__Image *_texture;
  GLuint _id;
  float shininess;
  GLfloat (_diffuse[4]);
  GLfloat (_specular[4]);
  GLfloat (_emissive[4]);
  PyObject *_filename;
  struct __pyx_t_5_soya__Pack (*(*_packs));
};

struct __pyx_vtabstruct_5_soya__Material {
  struct __pyx_vtabstruct_5_soya__CObj __pyx_base;
  struct __pyx_t_5_soya__Pack (*((*_pack)(struct __pyx_obj_5_soya__Material *,int )));
  void ((*_init_texture)(struct __pyx_obj_5_soya__Material *));
  void ((*_build_2D_mipmaps)(struct __pyx_obj_5_soya__Material *,int ));
  void ((*_compute_alpha)(struct __pyx_obj_5_soya__Material *));
  void ((*_activate)(struct __pyx_obj_5_soya__Material *));
  void ((*_inactivate)(struct __pyx_obj_5_soya__Material *));
};
static struct __pyx_vtabstruct_5_soya__Material *__pyx_vtabptr_5_soya__Material;


struct __pyx_obj_5_soya__Model {
  struct __pyx_obj_5_soya__CObj __pyx_base;
  PyObject *_filename;
};

struct __pyx_vtabstruct_5_soya__Model {
  struct __pyx_vtabstruct_5_soya__CObj __pyx_base;
  void ((*_instanced)(struct __pyx_obj_5_soya__Model *,struct __pyx_obj_5_soya__Body *,PyObject *));
  void ((*_batch)(struct __pyx_obj_5_soya__Model *,struct __pyx_obj_5_soya__Body *));
  void ((*_render)(struct __pyx_obj_5_soya__Model *,struct __pyx_obj_5_soya__Body *));
  int ((*_shadow)(struct __pyx_obj_5_soya__Model *,struct __pyx_obj_5_soya_CoordSyst *,struct __pyx_obj_5_soya__Light *));
  void ((*_get_box)(struct __pyx_obj_5_soya__Model *,float (*),float (*)));
  void ((*_raypick)(struct __pyx_obj_5_soya__Model *,struct __pyx_obj_5_soya_RaypickData *,struct __pyx_obj_5_soya_CoordSyst *));
  int ((*_raypick_b)(struct __pyx_obj_5_soya__Model *,struct __pyx_obj_5_soya_RaypickData *,struct __pyx_obj_5_soya_CoordSyst *));
  void ((*_collect_raypickables)(struct __pyx_obj_5_soya__Model *,__pyx_t_5_soya_Chunk (*),float (*),float (*),struct __pyx_obj_5_soya_CoordSyst *));
  struct __pyx_obj_5_soya__Model *((*_create_deformed_data)(struct __pyx_obj_5_soya__Model *));
  void ((*_attach)(struct __pyx_obj_5_soya__Model *,PyObject *));
  void ((*_detach)(struct __pyx_obj_5_soya__Model *,PyObject *));
  int ((*_is_attached)(struct __pyx_obj_5_soya__Model *,PyObject *));
  void ((*_attach_to_bone)(struct __pyx_obj_5_soya__Model *,struct __pyx_obj_5_soya_CoordSyst *,PyObject *));
  void ((*_detach_from_bone)(struct __pyx_obj_5_soya__Model *,struct __pyx_obj_5_soya_CoordSyst *));
  void ((*_advance_time)(struct __pyx_obj_5_soya__Model *,float ));
  void ((*_begin_round)(struct __pyx_obj_5_soya__Model *));
  PyObject *((*_get_attached_meshes)(struct __pyx_obj_5_soya__Model *));
  PyObject *((*_get_attached_coordsysts)(struct __pyx_obj_5_soya__Model *));
  void ((*_animate_blend_cycle)(struct __pyx_obj_5_soya__Model *,PyObject *,float ,float ));
  void ((*_animate_clear_cycle)(struct __pyx_obj_5_soya__Model *,PyObject *,float ));
  void ((*_animate_execute_action)(struct __pyx_obj_5_soya__Model *,PyObject *,float ,float ));
  void ((*_animate_reset)(struct __pyx_obj_5_soya__Model *));
  void ((*_set_lod_level)(struct __pyx_obj_5_soya__Model *,float ));
};
static struct __pyx_vtabstruct_5_soya__Model *__pyx_vtabptr_5_soya__Model;


struct __pyx_obj_5_soya__SimpleModel {
  struct __pyx_obj_5_soya__Model __pyx_base;
  int _option;
  PyObject *_materials;
  int _nb_faces;
  int _nb_vertices;
  int _nb_coords;
  int _nb_vnormals;
  int _nb_colors;
  int _nb_values;
  float (*_coords);
  float (*_vnormals);
  float (*_colors);
  float (*_values);
  int (*_vertex_coords);
  int (*_vertex_texcoords);
  int (*_vertex_diffuses);
  int (*_vertex_emissives);
  char (*_vertex_options);
  __pyx_t_5_soya_ModelFace (*_faces);
  int (*_neighbors);
  int (*_simple_neighbors);
  char (*_neighbors_side);
  char (*_simple_neighbors_side);
  __pyx_t_5_soya_DisplayLists (*_display_lists);
  float (*_sphere);
};

struct __pyx_vtabstruct_5_soya__SimpleModel {
  struct __pyx_vtabstruct_5_soya__Model __pyx_base;
  void ((*__setcstate_data__)(struct __pyx_obj_5_soya__SimpleModel *,PyObject *));
  void ((*_register_material)(struct __pyx_obj_5_soya__SimpleModel *,struct __pyx_obj_5_soya__Material *));
  void ((*_add_coord)(struct __pyx_obj_5_soya__SimpleModel *,struct __pyx_obj_5_soya__Vertex *));
  int ((*_register_value)(struct __pyx_obj_5_soya__SimpleModel *,float (*),int ));
  int ((*_register_color)(struct __pyx_obj_5_soya__SimpleModel *,float (*)));
  void ((*_add_face)(struct __pyx_obj_5_soya__SimpleModel *,struct __pyx_obj_5_soya__Face *,PyObject *,PyObject *,PyObject *,int ));
  int ((*_add_vertex)(struct __pyx_obj_5_soya__SimpleModel *,struct __pyx_obj_5_soya__Vertex *,PyObject *,PyObject *,PyObject *,int ));
  PyObject *((*_identify_vertices)(struct __pyx_obj_5_soya__SimpleModel *,PyObject *,float ));
  void ((*_compute_face_normals)(struct __pyx_obj_5_soya__SimpleModel *,PyObject *));
  void ((*_compute_vertex_normals)(struct __pyx_obj_5_soya__SimpleModel *,PyObject *,PyObject *,PyObject *));
  void ((*_compute_face_neighbors)(struct __pyx_obj_5_soya__SimpleModel *,PyObject *,PyObject *,PyObject *,int (*),char (*)));
  void ((*_build_sphere)(struct __pyx_obj_5_soya__SimpleModel *));
  void ((*_build_display_list)(struct __pyx_obj_5_soya__SimpleModel *));
  void ((*_init_display_list)(struct __pyx_obj_5_soya__SimpleModel *));
  void ((*_batch_face)(struct __pyx_obj_5_soya__SimpleModel *,__pyx_t_5_soya_ModelFace (*)));
  void ((*_face_raypick)(struct __pyx_obj_5_soya__SimpleModel *,__pyx_t_5_soya_ModelFace (*),float (*),struct __pyx_obj_5_soya_RaypickData *,struct __pyx_obj_5_soya_CoordSyst *));
  int ((*_face_raypick_b)(struct __pyx_obj_5_soya__SimpleModel *,__pyx_t_5_soya_ModelFace (*),float (*),struct __pyx_obj_5_soya_RaypickData *));
  void ((*_render_triangle)(struct __pyx_obj_5_soya__SimpleModel *,__pyx_t_5_soya_ModelFace (*)));
  void ((*_render_quad)(struct __pyx_obj_5_soya__SimpleModel *,__pyx_t_5_soya_ModelFace (*)));
  void ((*_render_vertex)(struct __pyx_obj_5_soya__SimpleModel *,int ,int ));
  int ((*_build_shadow)(struct __pyx_obj_5_soya__SimpleModel *,struct __pyx_obj_5_soya_CoordSyst *,struct __pyx_obj_5_soya__Light *,int ,int ));
};
static struct __pyx_vtabstruct_5_soya__SimpleModel *__pyx_vtabptr_5_soya__SimpleModel;


struct __pyx_obj_5_soya__CellShadingModel {
  struct __pyx_obj_5_soya__SimpleModel __pyx_base;
  struct __pyx_obj_5_soya__Material *_shader;
  float (_outline_color[4]);
  float _outline_width;
  float _outline_attenuation;
};

struct __pyx_vtabstruct_5_soya__CellShadingModel {
  struct __pyx_vtabstruct_5_soya__SimpleModel __pyx_base;
  void ((*_build_cellshading)(struct __pyx_obj_5_soya__CellShadingModel *,struct __pyx_obj_5_soya__Material *,PyObject *,float ,float ));
  void ((*_render_outline)(struct __pyx_obj_5_soya__CellShadingModel *,__pyx_t_5_soya_Frustum (*)));
  void ((*_prepare_cellshading_shades)(struct __pyx_obj_5_soya__CellShadingModel *,float (*),PyObject *));
  void ((*_prepare_cellshading)(struct __pyx_obj_5_soya__CellShadingModel *,struct __pyx_obj_5_soya_CoordSyst *,float (*)));
  float ((*_vertex_compute_cellshading)(struct __pyx_obj_5_soya__CellShadingModel *,float (*),float (*),PyObject *,float ));
  void ((*_render_triangle_cellshading)(struct __pyx_obj_5_soya__CellShadingModel *,__pyx_t_5_soya_ModelFace (*),float (*)));
  void ((*_render_quad_cellshading)(struct __pyx_obj_5_soya__CellShadingModel *,__pyx_t_5_soya_ModelFace (*),float (*)));
  void ((*_render_vertex_cellshading_smoothlit)(struct __pyx_obj_5_soya__CellShadingModel *,int ,int ,float (*)));
  void ((*_render_vertex_cellshading)(struct __pyx_obj_5_soya__CellShadingModel *,int ,int ,float (*)));
};
static struct __pyx_vtabstruct_5_soya__CellShadingModel *__pyx_vtabptr_5_soya__CellShadingModel;


struct __pyx_obj_5_soya__TreeModel {
  struct __pyx_obj_5_soya__SimpleModel __pyx_base;
  struct __pyx_t_5_soya__Node (*_tree);
};

struct __pyx_vtabstruct_5_soya__TreeModel {
  struct __pyx_vtabstruct_5_soya__SimpleModel __pyx_base;
  PyObject *((*_node2chunk)(struct __pyx_obj_5_soya__TreeModel *,struct __pyx_t_5_soya__Node (*),__pyx_t_5_soya_Chunk (*)));
  struct __pyx_t_5_soya__Node (*((*_chunk2node)(struct __pyx_obj_5_soya__TreeModel *,__pyx_t_5_soya_Chunk (*))));
  void ((*_build_tree)(struct __pyx_obj_5_soya__TreeModel *));
  void ((*_optimize_tree)(struct __pyx_obj_5_soya__TreeModel *,float ,int ,float ));
  void ((*compute_sphere)(struct __pyx_obj_5_soya__TreeModel *,__pyx_t_5_soya_ModelFace (*),float (*)));
  void ((*_batch_node)(struct __pyx_obj_5_soya__TreeModel *,struct __pyx_t_5_soya__Node (*),__pyx_t_5_soya_Frustum (*)));
  void ((*_node_raypick)(struct __pyx_obj_5_soya__TreeModel *,struct __pyx_t_5_soya__Node (*),float (*),struct __pyx_obj_5_soya_RaypickData *,struct __pyx_obj_5_soya_CoordSyst *));
  int ((*_node_raypick_b)(struct __pyx_obj_5_soya__TreeModel *,struct __pyx_t_5_soya__Node (*),float (*),struct __pyx_obj_5_soya_RaypickData *));
  void ((*_raypick_from_context)(struct __pyx_obj_5_soya__TreeModel *,struct __pyx_obj_5_soya_RaypickData *,__pyx_t_5_soya_Chunk (*)));
  int ((*_raypick_from_context_b)(struct __pyx_obj_5_soya__TreeModel *,struct __pyx_obj_5_soya_RaypickData *,__pyx_t_5_soya_Chunk (*)));
};
static struct __pyx_vtabstruct_5_soya__TreeModel *__pyx_vtabptr_5_soya__TreeModel;


struct __pyx_obj_5_soya__ModelData {
  struct __pyx_obj_5_soya__Model __pyx_base;
};

struct __pyx_vtabstruct_5_soya__ModelData {
  struct __pyx_vtabstruct_5_soya__Model __pyx_base;
};
static struct __pyx_vtabstruct_5_soya__ModelData *__pyx_vtabptr_5_soya__ModelData;


struct __pyx_obj_5_soya__AnimatedModelData {
  struct __pyx_obj_5_soya__ModelData __pyx_base;
  struct __pyx_obj_5_soya__Body *_body;
  struct __pyx_obj_5_soya__AnimatedModel *_model;
  PyObject *_attached_meshes;
  PyObject *_attached_coordsysts;
  struct CalModel (*_cal_model);
  float _delta_time;
  float (*_face_planes);
  float (*_coords);
  float (*_vnormals);
  int _face_plane_ok;
  int _vertex_ok;
};

struct __pyx_vtabstruct_5_soya__AnimatedModelData {
  struct __pyx_vtabstruct_5_soya__ModelData __pyx_base;
  void ((*_build_submeshes)(struct __pyx_obj_5_soya__AnimatedModelData *));
  void ((*_build_face_planes)(struct __pyx_obj_5_soya__AnimatedModelData *));
  void ((*_build_vertices)(struct __pyx_obj_5_soya__AnimatedModelData *,int ));
  void ((*_attach_all)(struct __pyx_obj_5_soya__AnimatedModelData *));
};
static struct __pyx_vtabstruct_5_soya__AnimatedModelData *__pyx_vtabptr_5_soya__AnimatedModelData;


struct __pyx_obj_5_soya_Position {
  struct __pyx_obj_5_soya__CObj __pyx_base;
  struct __pyx_obj_5_soya_CoordSyst *_parent;
};

struct __pyx_vtabstruct_5_soya_Position {
  struct __pyx_vtabstruct_5_soya__CObj __pyx_base;
  void ((*_into)(struct __pyx_obj_5_soya_Position *,struct __pyx_obj_5_soya_CoordSyst *,float (*)));
  void ((*_out)(struct __pyx_obj_5_soya_Position *,float (*)));
};
static struct __pyx_vtabstruct_5_soya_Position *__pyx_vtabptr_5_soya_Position;


struct __pyx_obj_5_soya__Point {
  struct __pyx_obj_5_soya_Position __pyx_base;
  float (_matrix[3]);
};

struct __pyx_vtabstruct_5_soya__Point {
  struct __pyx_vtabstruct_5_soya_Position __pyx_base;
};
static struct __pyx_vtabstruct_5_soya__Point *__pyx_vtabptr_5_soya__Point;


struct __pyx_obj_5_soya__Vector {
  struct __pyx_obj_5_soya__Point __pyx_base;
};

struct __pyx_vtabstruct_5_soya__Vector {
  struct __pyx_vtabstruct_5_soya__Point __pyx_base;
};
static struct __pyx_vtabstruct_5_soya__Vector *__pyx_vtabptr_5_soya__Vector;


struct __pyx_obj_5_soya__Vertex {
  struct __pyx_obj_5_soya__Point __pyx_base;
  float _tex_x;
  float _tex_y;
  PyObject *_diffuse;
  PyObject *_emissive;
  struct __pyx_obj_5_soya__Face *_face;
  struct __pyx_obj_5_soya__Vector *_normal;
};

struct __pyx_vtabstruct_5_soya__Vertex {
  struct __pyx_vtabstruct_5_soya__Point __pyx_base;
  void ((*_render)(struct __pyx_obj_5_soya__Vertex *,struct __pyx_obj_5_soya_CoordSyst *));
  float ((*_angle_at)(struct __pyx_obj_5_soya__Vertex *));
};
static struct __pyx_vtabstruct_5_soya__Vertex *__pyx_vtabptr_5_soya__Vertex;


struct __pyx_obj_5_soya_CoordSyst {
  struct __pyx_obj_5_soya_Position __pyx_base;
  float (_matrix[19]);
  float (__root_matrix[19]);
  float (__inverted_root_matrix[19]);
  float (_render_matrix[19]);
  int _frustum_id;
  int _validity;
  int __raypick_data;
  int _option;
  int _auto_static_count;
};

struct __pyx_vtabstruct_5_soya_CoordSyst {
  struct __pyx_vtabstruct_5_soya_Position __pyx_base;
  void ((*_batch)(struct __pyx_obj_5_soya_CoordSyst *,struct __pyx_obj_5_soya_CoordSyst *));
  void ((*_render)(struct __pyx_obj_5_soya_CoordSyst *,struct __pyx_obj_5_soya_CoordSyst *));
  int ((*_shadow)(struct __pyx_obj_5_soya_CoordSyst *,struct __pyx_obj_5_soya_CoordSyst *,struct __pyx_obj_5_soya__Light *));
  void ((*_raypick)(struct __pyx_obj_5_soya_CoordSyst *,struct __pyx_obj_5_soya_RaypickData *,struct __pyx_obj_5_soya_CoordSyst *));
  int ((*_raypick_b)(struct __pyx_obj_5_soya_CoordSyst *,struct __pyx_obj_5_soya_RaypickData *,struct __pyx_obj_5_soya_CoordSyst *));
  void ((*_collect_raypickables)(struct __pyx_obj_5_soya_CoordSyst *,__pyx_t_5_soya_Chunk (*),float (*),float (*)));
  int ((*_contains)(struct __pyx_obj_5_soya_CoordSyst *,struct __pyx_obj_5_soya__CObj *));
  float (*((*_raypick_data)(struct __pyx_obj_5_soya_CoordSyst *,struct __pyx_obj_5_soya_RaypickData *)));
  float ((*_distance_out)(struct __pyx_obj_5_soya_CoordSyst *,float ));
  void ((*_invalidate)(struct __pyx_obj_5_soya_CoordSyst *));
  void ((*_check_lefthanded)(struct __pyx_obj_5_soya_CoordSyst *));
  float (*((*_root_matrix)(struct __pyx_obj_5_soya_CoordSyst *)));
  float (*((*_inverted_root_matrix)(struct __pyx_obj_5_soya_CoordSyst *)));
  struct __pyx_obj_5_soya__World *((*_get_root)(struct __pyx_obj_5_soya_CoordSyst *));
  void ((*_get_box)(struct __pyx_obj_5_soya_CoordSyst *,float (*),float (*)));
  void ((*_get_sphere)(struct __pyx_obj_5_soya_CoordSyst *,float (*)));
  void ((*_go_static)(struct __pyx_obj_5_soya_CoordSyst *));
  void ((*_go_not_static)(struct __pyx_obj_5_soya_CoordSyst *));
};
static struct __pyx_vtabstruct_5_soya_CoordSyst *__pyx_vtabptr_5_soya_CoordSyst;


struct __pyx_obj_5_soya__Camera {
  struct __pyx_obj_5_soya_CoordSyst __pyx_base;
  struct __pyx_obj_5_soya__World *_to_render;
  float _front;
  float _back;
  float _fov;
  __pyx_t_5_soya_Frustum (*_frustum);
  int (_viewport[4]);
  PyObject *_master;
};

struct __pyx_vtabstruct_5_soya__Camera {
  struct __pyx_vtabstruct_5_soya_CoordSyst __pyx_base;
  void ((*_init_frustum)(struct __pyx_obj_5_soya__Camera *));
  void ((*_subrender_scene)(struct __pyx_obj_5_soya__Camera *));
  void ((*_render_scene)(struct __pyx_obj_5_soya__Camera *));
};
static struct __pyx_vtabstruct_5_soya__Camera *__pyx_vtabptr_5_soya__Camera;


struct __pyx_obj_5_soya__Light {
  struct __pyx_obj_5_soya_CoordSyst __pyx_base;
  float radius;
  float _w;
  float _constant;
  float _linear;
  float _quadratic;
  float _angle;
  float _exponent;
  float (_colors[16]);
  float (_data[3]);
  int _id;
  int _gl_id_enabled;
  PyObject *_static_shadow_displaylists;
};

struct __pyx_vtabstruct_5_soya__Light {
  struct __pyx_vtabstruct_5_soya_CoordSyst __pyx_base;
  int ((*_shadow_at)(struct __pyx_obj_5_soya__Light *,float (*)));
  float ((*_spotlight_at)(struct __pyx_obj_5_soya__Light *,float (*)));
  float ((*_attenuation_at)(struct __pyx_obj_5_soya__Light *,float (*)));
  void ((*_static_light_at)(struct __pyx_obj_5_soya__Light *,float (*),float (*),int ,float (*)));
  void ((*_cast_into)(struct __pyx_obj_5_soya__Light *,struct __pyx_obj_5_soya_CoordSyst *));
  void ((*_activate)(struct __pyx_obj_5_soya__Light *));
  void ((*_compute_radius)(struct __pyx_obj_5_soya__Light *));
};
static struct __pyx_vtabstruct_5_soya__Light *__pyx_vtabptr_5_soya__Light;


struct __pyx_obj_5_soya__Body {
  struct __pyx_obj_5_soya_CoordSyst __pyx_base;
  struct __pyx_obj_5_soya__Model *_model;
  struct __pyx_obj_5_soya__Model *_data;
};

struct __pyx_vtabstruct_5_soya__Body {
  struct __pyx_vtabstruct_5_soya_CoordSyst __pyx_base;
};
static struct __pyx_vtabstruct_5_soya__Body *__pyx_vtabptr_5_soya__Body;


struct __pyx_obj_5_soya__World {
  struct __pyx_obj_5_soya__Body __pyx_base;
  PyObject *children;
  struct __pyx_obj_5_soya__Atmosphere *_atmosphere;
  PyObject *_filename;
  struct __pyx_obj_5_soya_ModelBuilder *_model_builder;
};

struct __pyx_vtabstruct_5_soya__World {
  struct __pyx_vtabstruct_5_soya__Body __pyx_base;
  void ((*_search_all)(struct __pyx_obj_5_soya__World *,PyObject *,PyObject *));
};
static struct __pyx_vtabstruct_5_soya__World *__pyx_vtabptr_5_soya__World;


struct __pyx_obj_5_soya__Face {
  struct __pyx_obj_5_soya_CoordSyst __pyx_base;
  PyObject *_vertices;
  struct __pyx_obj_5_soya__Material *_material;
  struct __pyx_obj_5_soya__Vector *_normal;
};

struct __pyx_vtabstruct_5_soya__Face {
  struct __pyx_vtabstruct_5_soya_CoordSyst __pyx_base;
  void ((*_compute_normal)(struct __pyx_obj_5_soya__Face *));
};
static struct __pyx_vtabstruct_5_soya__Face *__pyx_vtabptr_5_soya__Face;


struct __pyx_obj_5_soya__AnimatedModel {
  struct __pyx_obj_5_soya__Model __pyx_base;
  int _option;
  int _nb_faces;
  int _nb_vertices;
  float (_sphere[4]);
  PyObject *_meshes;
  PyObject *_animations;
  PyObject *_materials;
  PyObject *_submeshes;
  PyObject *_full_filename;
  struct CalCoreModel (*_core_model);
  struct __pyx_obj_5_soya__Material *_shader;
  float (_outline_color[4]);
  float _outline_width;
  float _outline_attenuation;
};

struct __pyx_vtabstruct_5_soya__AnimatedModel {
  struct __pyx_vtabstruct_5_soya__Model __pyx_base;
  void ((*_build_submeshes)(struct __pyx_obj_5_soya__AnimatedModel *));
  void ((*_set_face_neighborhood)(struct __pyx_obj_5_soya__AnimatedModel *,int ,int ,GLfloat (*)));
  void ((*_set_cell_shading)(struct __pyx_obj_5_soya__AnimatedModel *,struct __pyx_obj_5_soya__Material *,GLfloat (*),GLfloat ));
  void ((*_prepare_cellshading)(struct __pyx_obj_5_soya__AnimatedModel *,struct __pyx_obj_5_soya_CoordSyst *,float (*),int ,float (*),float (*)));
  void ((*_prepare_cellshading_shades)(struct __pyx_obj_5_soya__AnimatedModel *,float (*),PyObject *,int ,float (*),float (*)));
  void ((*_render_outline)(struct __pyx_obj_5_soya__AnimatedModel *,struct __pyx_obj_5_soya__Cal3dSubMesh *,__pyx_t_5_soya_Frustum (*),float (*),float (*),float (*)));
  struct __pyx_obj_5_soya__Material *((*_get_material_4_cal3d)(struct __pyx_obj_5_soya__AnimatedModel *,PyObject *,float ,float ,float ,float ,float ,float ,float ,float ,float ));
  struct __pyx_obj_5_soya__Material *((*_create_material_4_cal3d)(struct __pyx_obj_5_soya__AnimatedModel *,PyObject *,float ,float ,float ,float ,float ,float ,float ,float ,float ));
  void ((*_set_texture_from_model)(struct __pyx_obj_5_soya__AnimatedModel *,struct __pyx_obj_5_soya__Material *,PyObject *));
  int ((*_shadow2)(struct __pyx_obj_5_soya__AnimatedModel *,struct __pyx_obj_5_soya__Cal3dSubMesh *,struct __pyx_obj_5_soya__Body *,struct __pyx_obj_5_soya__Light *,float (*),float (*),float (*)));
  void ((*_build_vertices)(struct __pyx_obj_5_soya__AnimatedModel *,struct __pyx_obj_5_soya__AnimatedModelData *));
};
static struct __pyx_vtabstruct_5_soya__AnimatedModel *__pyx_vtabptr_5_soya__AnimatedModel;


struct __pyx_obj_5_soya__Sprite {
  struct __pyx_obj_5_soya_CoordSyst __pyx_base;
  float _width;
  float _height;
  float (_color[4]);
  struct __pyx_obj_5_soya__Material *_material;
};

struct __pyx_vtabstruct_5_soya__Sprite {
  struct __pyx_vtabstruct_5_soya_CoordSyst __pyx_base;
  void ((*_compute_alpha)(struct __pyx_obj_5_soya__Sprite *));
};
static struct __pyx_vtabstruct_5_soya__Sprite *__pyx_vtabptr_5_soya__Sprite;


struct __pyx_obj_5_soya__Portal {
  struct __pyx_obj_5_soya_CoordSyst __pyx_base;
  struct __pyx_obj_5_soya__World *_beyond;
  PyObject *_beyond_name;
  double (*_equation);
  struct __pyx_obj_5_soya_Context *_context;
  int _nb_vertices;
  float (*_coords);
};

struct __pyx_vtabstruct_5_soya__Portal {
  struct __pyx_vtabstruct_5_soya_CoordSyst __pyx_base;
  void ((*_compute_clipping_planes)(struct __pyx_obj_5_soya__Portal *));
  void ((*_compute_points)(struct __pyx_obj_5_soya__Portal *));
  void ((*_atmosphere_clear_part)(struct __pyx_obj_5_soya__Portal *));
  void ((*_draw_fog)(struct __pyx_obj_5_soya__Portal *,struct __pyx_obj_5_soya__Atmosphere *));
};
static struct __pyx_vtabstruct_5_soya__Portal *__pyx_vtabptr_5_soya__Portal;


struct __pyx_obj_5_soya__Terrain {
  struct __pyx_obj_5_soya_CoordSyst __pyx_base;
  PyObject *_materials;
  __pyx_t_5_soya_TerrainVertex (*_vertices);
  char (*_vertex_options);
  int (*_vertex_colors);
  float (*_vertex_geos);
  float (*_normals);
  int _nb_colors;
  float (*_colors);
  int _nb_vertex_width;
  int _nb_vertex_depth;
  int _patch_size;
  int _max_level;
  float _texture_factor;
  float _scale_factor;
  float _split_factor;
  int _nb_patchs;
  int _nb_patch_width;
  int _nb_patch_depth;
  struct __pyx_t_5_soya__TerrainPatch (*_patchs);
};

struct __pyx_vtabstruct_5_soya__Terrain {
  struct __pyx_vtabstruct_5_soya_CoordSyst __pyx_base;
  __pyx_t_5_soya_TerrainVertex (*((*_get_vertex)(struct __pyx_obj_5_soya__Terrain *,int ,int )));
  void ((*_check_size)(struct __pyx_obj_5_soya__Terrain *));
  void ((*_free_patchs)(struct __pyx_obj_5_soya__Terrain *));
  void ((*__del__)(struct __pyx_obj_5_soya__Terrain *));
  void ((*_add_material)(struct __pyx_obj_5_soya__Terrain *,struct __pyx_obj_5_soya__Material *));
  float ((*_get_height)(struct __pyx_obj_5_soya__Terrain *,int ,int ));
  void ((*_set_height)(struct __pyx_obj_5_soya__Terrain *,int ,int ,float ));
  void ((*_init)(struct __pyx_obj_5_soya__Terrain *));
  void ((*_compute_normal)(struct __pyx_obj_5_soya__Terrain *,int ,int ));
  void ((*_compute_normals)(struct __pyx_obj_5_soya__Terrain *));
  void ((*_compute_coords)(struct __pyx_obj_5_soya__Terrain *));
  void ((*_create_patch)(struct __pyx_obj_5_soya__Terrain *,struct __pyx_t_5_soya__TerrainPatch (*),int ,int ,int ));
  void ((*_create_patchs)(struct __pyx_obj_5_soya__Terrain *));
  int ((*_register_color)(struct __pyx_obj_5_soya__Terrain *,float (*)));
  void ((*_tri_split)(struct __pyx_obj_5_soya__Terrain *,struct __pyx_t_5_soya__TerrainTri (*)));
  int ((*_tri_merge_child)(struct __pyx_obj_5_soya__Terrain *,struct __pyx_t_5_soya__TerrainTri (*)));
  void ((*_tri_set_level)(struct __pyx_obj_5_soya__Terrain *,struct __pyx_t_5_soya__TerrainTri (*),char ));
  void ((*_patch_set_level)(struct __pyx_obj_5_soya__Terrain *,struct __pyx_t_5_soya__TerrainPatch (*),char ));
  int ((*_patch_update)(struct __pyx_obj_5_soya__Terrain *,struct __pyx_t_5_soya__TerrainPatch (*),__pyx_t_5_soya_Frustum (*),float (*)));
  void ((*_tri_force_presence)(struct __pyx_obj_5_soya__Terrain *,struct __pyx_t_5_soya__TerrainTri (*),__pyx_t_5_soya_TerrainVertex (*)));
  void ((*_force_presence)(struct __pyx_obj_5_soya__Terrain *));
  void ((*_tri_batch)(struct __pyx_obj_5_soya__Terrain *,struct __pyx_t_5_soya__TerrainTri (*),__pyx_t_5_soya_Frustum (*)));
  void ((*_patch_batch)(struct __pyx_obj_5_soya__Terrain *,struct __pyx_t_5_soya__TerrainPatch (*),__pyx_t_5_soya_Frustum (*)));
  void ((*_tri_render_middle)(struct __pyx_obj_5_soya__Terrain *,struct __pyx_t_5_soya__TerrainTri (*)));
  void ((*_tri_render_secondpass)(struct __pyx_obj_5_soya__Terrain *,struct __pyx_t_5_soya__TerrainTri (*)));
  void ((*_tri_raypick)(struct __pyx_obj_5_soya__Terrain *,struct __pyx_t_5_soya__TerrainTri (*),float (*),struct __pyx_obj_5_soya_RaypickData *));
  int ((*_tri_raypick_b)(struct __pyx_obj_5_soya__Terrain *,struct __pyx_t_5_soya__TerrainTri (*),float (*),int ));
  void ((*_full_raypick)(struct __pyx_obj_5_soya__Terrain *,__pyx_t_5_soya_TerrainVertex (*),__pyx_t_5_soya_TerrainVertex (*),__pyx_t_5_soya_TerrainVertex (*),float (*),float (*),struct __pyx_obj_5_soya_RaypickData *));
  void ((*_full_raypick_rect)(struct __pyx_obj_5_soya__Terrain *,int ,int ,int ,int ,float (*),struct __pyx_obj_5_soya_RaypickData *));
  int ((*_full_raypick_b)(struct __pyx_obj_5_soya__Terrain *,__pyx_t_5_soya_TerrainVertex (*),__pyx_t_5_soya_TerrainVertex (*),__pyx_t_5_soya_TerrainVertex (*),float (*),float (*),int ));
  int ((*_full_raypick_rect_b)(struct __pyx_obj_5_soya__Terrain *,int ,int ,int ,int ,float (*),int ));
  void ((*_check_vertex_options)(struct __pyx_obj_5_soya__Terrain *));
  int ((*_check_color)(struct __pyx_obj_5_soya__Terrain *,float (*)));
  void ((*_vertex_render_special)(struct __pyx_obj_5_soya__Terrain *,__pyx_t_5_soya_TerrainVertex (*)));
};
static struct __pyx_vtabstruct_5_soya__Terrain *__pyx_vtabptr_5_soya__Terrain;


struct __pyx_obj_5_soya__Atmosphere {
  struct __pyx_obj_5_soya__CObj __pyx_base;
  int _option;
  int _fog_type;
  float _fog_start;
  float _fog_end;
  float _fog_density;
  float (_ambient[4]);
  float (_bg_color[4]);
  float (_fog_color[4]);
};

struct __pyx_vtabstruct_5_soya__Atmosphere {
  struct __pyx_vtabstruct_5_soya__CObj __pyx_base;
  void ((*_clear)(struct __pyx_obj_5_soya__Atmosphere *));
  void ((*_draw_bg)(struct __pyx_obj_5_soya__Atmosphere *));
  void ((*_render)(struct __pyx_obj_5_soya__Atmosphere *));
  float ((*_fog_factor_at)(struct __pyx_obj_5_soya__Atmosphere *,float (*)));
};
static struct __pyx_vtabstruct_5_soya__Atmosphere *__pyx_vtabptr_5_soya__Atmosphere;


struct __pyx_obj_5_soya_Renderer {
  PyObject_HEAD
  struct __pyx_vtabstruct_5_soya_Renderer *__pyx_vtab;
  int engine_option;
  int state;
  struct __pyx_obj_5_soya__World *root_object;
  struct __pyx_obj_5_soya__Camera *current_camera;
  struct __pyx_obj_5_soya__Material *current_material;
  __pyx_t_5_soya_Frustum (*root_frustum);
  __pyx_t_5_soya_Chunk (*frustums);
  struct __pyx_obj_5_soya_CoordSyst *current_coordsyst;
  struct __pyx_obj_5_soya_Context *current_context;
  PyObject *contexts;
  int nb_contexts;
  int max_contexts;
  struct __pyx_obj_5_soya__Atmosphere *root_atmosphere;
  __pyx_t_5_soya_Chunk (*opaque);
  __pyx_t_5_soya_Chunk (*secondpass);
  __pyx_t_5_soya_Chunk (*alpha);
  __pyx_t_5_soya_Chunk (*specials);
  PyObject *top_lights;
  PyObject *worlds_made;
  PyObject *portals;
  PyObject *watercubes;
  __pyx_t_5_soya_Chunk (*data);
  __pyx_t_5_soya_Chunk (*used_opaque_packs);
  __pyx_t_5_soya_Chunk (*used_secondpass_packs);
  __pyx_t_5_soya_Chunk (*used_alpha_packs);
  float (*(*colors));
  SDL_Surface (*screen);
  int screen_width;
  int screen_height;
  float delta_time;
};

struct __pyx_vtabstruct_5_soya_Renderer {
  __pyx_t_5_soya_Frustum (*((*_frustum)(struct __pyx_obj_5_soya_Renderer *,struct __pyx_obj_5_soya_CoordSyst *)));
  struct __pyx_obj_5_soya_Context *((*_context)(struct __pyx_obj_5_soya_Renderer *));
  void ((*_activate_context_over)(struct __pyx_obj_5_soya_Renderer *,struct __pyx_obj_5_soya_Context *,struct __pyx_obj_5_soya_Context *));
  void ((*_reset)(struct __pyx_obj_5_soya_Renderer *));
  void ((*_batch)(struct __pyx_obj_5_soya_Renderer *,__pyx_t_5_soya_Chunk (*),PyObject *,struct __pyx_obj_5_soya_CoordSyst *,int ));
  void ((*_render)(struct __pyx_obj_5_soya_Renderer *));
  void ((*_render_list)(struct __pyx_obj_5_soya_Renderer *,__pyx_t_5_soya_Chunk (*)));
  void ((*_clear_screen)(struct __pyx_obj_5_soya_Renderer *,float (*)));
  void ((*_render_shadows)(struct __pyx_obj_5_soya_Renderer *));
};
static struct __pyx_vtabstruct_5_soya_Renderer *__pyx_vtabptr_5_soya_Renderer;


struct __pyx_obj_5_soya_Context {
  PyObject_HEAD
  PyObject *lights;
  struct __pyx_obj_5_soya__Atmosphere *atmosphere;
  struct __pyx_obj_5_soya__Portal *portal;
};


struct __pyx_obj_5_soya_RaypickData {
  PyObject_HEAD
  int option;
  __pyx_t_5_soya_Chunk (*raypicked);
  __pyx_t_5_soya_Chunk (*raypick_data);
  float (root_data[7]);
  float (normal[3]);
  float result;
  float root_result;
  struct __pyx_obj_5_soya_CoordSyst *result_coordsyst;
};


struct __pyx_obj_5_soya_RaypickContext {
  PyObject_HEAD
  __pyx_t_5_soya_Chunk (*_items);
  struct __pyx_obj_5_soya__World *_root;
};


struct __pyx_obj_5_soya_MainLoop {
  PyObject_HEAD
  PyObject *_next_round_tasks;
  PyObject *_return_value;
  PyObject *_scenes;
  double round_duration;
  double min_frame_duration;
  double fps;
  int running;
  int will_render;
  double _time;
  double _time_since_last_round;
  double _last_fps_computation_time;
  int _nb_frame;
};


struct __pyx_obj_5_soya_Glyph {
  PyObject_HEAD
  float _pixels_x1;
  float _pixels_y1;
  float _pixels_x2;
  float _pixels_y2;
  float width;
  float height;
  float y;
  float x;
  PyObject *unichar;
};


struct __pyx_obj_5_soya__Font {
  PyObject_HEAD
  struct __pyx_vtabstruct_5_soya__Font *__pyx_vtab;
  FT_Face _face;
  PyObject *filename;
  int _width;
  int _height;
  PyObject *_glyphs;
  GLubyte (*_pixels);
  int _current_x;
  int _current_y;
  int _current_height;
  int _pixels_height;
  int _rendering;
  GLuint _tex_id;
};

struct __pyx_vtabstruct_5_soya__Font {
  struct __pyx_obj_5_soya_Glyph *((*_get_glyph)(struct __pyx_obj_5_soya__Font *,PyObject *));
  PyObject *((*_gen_glyph)(struct __pyx_obj_5_soya__Font *,PyObject *,int ));
  void ((*_sizeup_pixel)(struct __pyx_obj_5_soya__Font *,int ));
  void ((*_init)(struct __pyx_obj_5_soya__Font *));
};
static struct __pyx_vtabstruct_5_soya__Font *__pyx_vtabptr_5_soya__Font;


struct __pyx_obj_5_soya_ModelBuilder {
  struct __pyx_obj_5_soya__CObj __pyx_base;
};

struct __pyx_vtabstruct_5_soya_ModelBuilder {
  struct __pyx_vtabstruct_5_soya__CObj __pyx_base;
  struct __pyx_obj_5_soya__Model *((*_to_model)(struct __pyx_obj_5_soya_ModelBuilder *,struct __pyx_obj_5_soya__World *));
};
static struct __pyx_vtabstruct_5_soya_ModelBuilder *__pyx_vtabptr_5_soya_ModelBuilder;


struct __pyx_obj_5_soya_Traveling {
  struct __pyx_obj_5_soya__CObj __pyx_base;
  struct __pyx_obj_5_soya_CoordSyst *_incline_as;
  int _smooth_move;
  int _smooth_rotation;
};

struct __pyx_vtabstruct_5_soya_Traveling {
  struct __pyx_vtabstruct_5_soya__CObj __pyx_base;
};
static struct __pyx_vtabstruct_5_soya_Traveling *__pyx_vtabptr_5_soya_Traveling;


struct __pyx_obj_5_soya__TravelingCamera {
  struct __pyx_obj_5_soya__Camera __pyx_base;
  PyObject *_travelings;
  struct __pyx_obj_5_soya_Traveling *_traveling;
  float _speed_value;
  float _proportion;
  struct __pyx_obj_5_soya__Vector *_speed;
};

struct __pyx_vtabstruct_5_soya__TravelingCamera {
  struct __pyx_vtabstruct_5_soya__Camera __pyx_base;
  void ((*_traveling_changed)(struct __pyx_obj_5_soya__TravelingCamera *));
};
static struct __pyx_vtabstruct_5_soya__TravelingCamera *__pyx_vtabptr_5_soya__TravelingCamera;


struct __pyx_obj_5_soya__Deform {
  struct __pyx_obj_5_soya__ModelData __pyx_base;
  struct __pyx_obj_5_soya__Model *_model;
  struct __pyx_obj_5_soya__Model *_data;
  int _option;
  float _time;
  float _time_speed;
};

struct __pyx_vtabstruct_5_soya__Deform {
  struct __pyx_vtabstruct_5_soya__ModelData __pyx_base;
  PyObject *((*_set_model)(struct __pyx_obj_5_soya__Deform *,struct __pyx_obj_5_soya__Model *));
  PyObject *((*_deform_points)(struct __pyx_obj_5_soya__Deform *,float (*),float (*),int ));
  PyObject *((*_deform_point)(struct __pyx_obj_5_soya__Deform *,float (*),float (*)));
};
static struct __pyx_vtabstruct_5_soya__Deform *__pyx_vtabptr_5_soya__Deform;


struct __pyx_obj_5_soya__NoBackgroundAtmosphere {
  struct __pyx_obj_5_soya__Atmosphere __pyx_base;
};

struct __pyx_vtabstruct_5_soya__NoBackgroundAtmosphere {
  struct __pyx_vtabstruct_5_soya__Atmosphere __pyx_base;
};
static struct __pyx_vtabstruct_5_soya__NoBackgroundAtmosphere *__pyx_vtabptr_5_soya__NoBackgroundAtmosphere;


struct __pyx_obj_5_soya__SkyAtmosphere {
  struct __pyx_obj_5_soya__Atmosphere __pyx_base;
  float (_sky_color[4]);
  float _cloud_scale;
  struct __pyx_obj_5_soya__Material *_cloud;
  PyObject *_sky_box;
};

struct __pyx_vtabstruct_5_soya__SkyAtmosphere {
  struct __pyx_vtabstruct_5_soya__Atmosphere __pyx_base;
  void ((*_draw_sky_plane)(struct __pyx_obj_5_soya__SkyAtmosphere *));
  void ((*_draw_sky_box)(struct __pyx_obj_5_soya__SkyAtmosphere *));
};
static struct __pyx_vtabstruct_5_soya__SkyAtmosphere *__pyx_vtabptr_5_soya__SkyAtmosphere;


struct __pyx_obj_5_soya_PythonCoordSyst {
  struct __pyx_obj_5_soya_CoordSyst __pyx_base;
};

struct __pyx_vtabstruct_5_soya_PythonCoordSyst {
  struct __pyx_vtabstruct_5_soya_CoordSyst __pyx_base;
};
static struct __pyx_vtabstruct_5_soya_PythonCoordSyst *__pyx_vtabptr_5_soya_PythonCoordSyst;


struct __pyx_obj_5_soya_CoordSystState {
  struct __pyx_obj_5_soya_CoordSyst __pyx_base;
  float (_quaternion[4]);
};

struct __pyx_vtabstruct_5_soya_CoordSystState {
  struct __pyx_vtabstruct_5_soya_CoordSyst __pyx_base;
  void ((*_check_state_validity)(struct __pyx_obj_5_soya_CoordSystState *));
};
static struct __pyx_vtabstruct_5_soya_CoordSystState *__pyx_vtabptr_5_soya_CoordSystState;


struct __pyx_obj_5_soya__FixTraveling {
  struct __pyx_obj_5_soya_Traveling __pyx_base;
  struct __pyx_obj_5_soya_Position *_target;
  struct __pyx_obj_5_soya_Position *_direction;
};

struct __pyx_vtabstruct_5_soya__FixTraveling {
  struct __pyx_vtabstruct_5_soya_Traveling __pyx_base;
};
static struct __pyx_vtabstruct_5_soya__FixTraveling *__pyx_vtabptr_5_soya__FixTraveling;


struct __pyx_obj_5_soya__ThirdPersonTraveling {
  struct __pyx_obj_5_soya_Traveling __pyx_base;
  struct __pyx_obj_5_soya_Position *_target;
  struct __pyx_obj_5_soya__Point *__target;
  struct __pyx_obj_5_soya__Point *_best;
  struct __pyx_obj_5_soya__Point *_result;
  struct __pyx_obj_5_soya__Point *__direction;
  struct __pyx_obj_5_soya__Vector *_direction;
  struct __pyx_obj_5_soya__Vector *__normal;
  float _distance;
  float _offset_y;
  float _offset_y2;
  float _lateral_angle;
  float _top_view;
  float _speed;
  struct __pyx_obj_5_soya_RaypickContext *_context;
};

struct __pyx_vtabstruct_5_soya__ThirdPersonTraveling {
  struct __pyx_vtabstruct_5_soya_Traveling __pyx_base;
  float ((*_check)(struct __pyx_obj_5_soya__ThirdPersonTraveling *,struct __pyx_obj_5_soya_RaypickContext *,struct __pyx_obj_5_soya_Position *,struct __pyx_obj_5_soya__Vector *,struct __pyx_obj_5_soya__Point *));
};
static struct __pyx_vtabstruct_5_soya__ThirdPersonTraveling *__pyx_vtabptr_5_soya__ThirdPersonTraveling;


struct __pyx_obj_5_soya__PythonMaterial {
  struct __pyx_obj_5_soya__Material __pyx_base;
};

struct __pyx_vtabstruct_5_soya__PythonMaterial {
  struct __pyx_vtabstruct_5_soya__Material __pyx_base;
};
static struct __pyx_vtabstruct_5_soya__PythonMaterial *__pyx_vtabptr_5_soya__PythonMaterial;


struct __pyx_obj_5_soya__CylinderSprite {
  struct __pyx_obj_5_soya__Sprite __pyx_base;
};

struct __pyx_vtabstruct_5_soya__CylinderSprite {
  struct __pyx_vtabstruct_5_soya__Sprite __pyx_base;
};
static struct __pyx_vtabstruct_5_soya__CylinderSprite *__pyx_vtabptr_5_soya__CylinderSprite;


struct __pyx_obj_5_soya__Bonus {
  struct __pyx_obj_5_soya_CoordSyst __pyx_base;
  float _angle;
  float (_color[4]);
  struct __pyx_obj_5_soya__Material *_material;
  struct __pyx_obj_5_soya__Material *_halo;
};

struct __pyx_vtabstruct_5_soya__Bonus {
  struct __pyx_vtabstruct_5_soya_CoordSyst __pyx_base;
};
static struct __pyx_vtabstruct_5_soya__Bonus *__pyx_vtabptr_5_soya__Bonus;


struct __pyx_obj_5_soya__Particles {
  struct __pyx_obj_5_soya_CoordSyst __pyx_base;
  struct __pyx_obj_5_soya__Material *_material;
  struct __pyx_obj_5_soya_CoordSyst *_particle_coordsyst;
  int _nb_particles;
  int _nb_max_particles;
  int _particle_size;
  float (*_particles);
  float _delta_time;
  int _nb_colors;
  int _nb_sizes;
  float (*_fading_colors);
  float (*_sizes);
  int _nb_creatable_particles;
  int _max_particles_per_round;
};

struct __pyx_vtabstruct_5_soya__Particles {
  struct __pyx_vtabstruct_5_soya_CoordSyst __pyx_base;
  void ((*_reinit)(struct __pyx_obj_5_soya__Particles *));
  void ((*_advance)(struct __pyx_obj_5_soya__Particles *,float ));
  void ((*_compute_alpha)(struct __pyx_obj_5_soya__Particles *));
  void ((*_get_fading_color)(struct __pyx_obj_5_soya__Particles *,float ,float ,float (*)));
  void ((*_get_size)(struct __pyx_obj_5_soya__Particles *,float ,float ,float (*)));
  float (*((*_generate)(struct __pyx_obj_5_soya__Particles *,int ,float )));
};
static struct __pyx_vtabstruct_5_soya__Particles *__pyx_vtabptr_5_soya__Particles;


struct __pyx_obj_5_soya_FlagFirework {
  struct __pyx_obj_5_soya__Particles __pyx_base;
  struct __pyx_obj_5_soya__Particles *_subgenerator;
  int _nb_sub_particles;
};

struct __pyx_vtabstruct_5_soya_FlagFirework {
  struct __pyx_vtabstruct_5_soya__Particles __pyx_base;
};
static struct __pyx_vtabstruct_5_soya_FlagFirework *__pyx_vtabptr_5_soya_FlagFirework;


struct __pyx_obj_5_soya_SimpleModelBuilder {
  struct __pyx_obj_5_soya_ModelBuilder __pyx_base;
  int _shadow;
  float _max_face_angle;
};

struct __pyx_vtabstruct_5_soya_SimpleModelBuilder {
  struct __pyx_vtabstruct_5_soya_ModelBuilder __pyx_base;
};
static struct __pyx_vtabstruct_5_soya_SimpleModelBuilder *__pyx_vtabptr_5_soya_SimpleModelBuilder;


struct __pyx_obj_5_soya_TreeModelBuilder {
  struct __pyx_obj_5_soya_SimpleModelBuilder __pyx_base;
  float _collapsing_distance;
  int _quality;
  float _max_child_radius;
};

struct __pyx_vtabstruct_5_soya_TreeModelBuilder {
  struct __pyx_vtabstruct_5_soya_SimpleModelBuilder __pyx_base;
};
static struct __pyx_vtabstruct_5_soya_TreeModelBuilder *__pyx_vtabptr_5_soya_TreeModelBuilder;


struct __pyx_obj_5_soya_CellShadingModelBuilder {
  struct __pyx_obj_5_soya_SimpleModelBuilder __pyx_base;
  struct __pyx_obj_5_soya__Material *_shader;
  PyObject *_outline_color;
  float _outline_width;
  float _outline_attenuation;
};

struct __pyx_vtabstruct_5_soya_CellShadingModelBuilder {
  struct __pyx_vtabstruct_5_soya_SimpleModelBuilder __pyx_base;
};
static struct __pyx_vtabstruct_5_soya_CellShadingModelBuilder *__pyx_vtabptr_5_soya_CellShadingModelBuilder;


struct __pyx_obj_5_soya__Cal3dSubMesh {
  PyObject_HEAD
  struct __pyx_vtabstruct_5_soya__Cal3dSubMesh *__pyx_vtab;
  int _option;
  int _mesh;
  int _submesh;
  struct __pyx_obj_5_soya__Material *_material;
  int _nb_faces;
  int _nb_vertices;
  int (*_faces);
  int (*_face_neighbors);
};

struct __pyx_vtabstruct_5_soya__Cal3dSubMesh {
  PyObject *((*_build)(struct __pyx_obj_5_soya__Cal3dSubMesh *,struct __pyx_obj_5_soya__AnimatedModel *,struct CalRenderer (*),struct CalCoreModel (*),struct CalCoreMesh (*),int ,int ));
  void ((*_build_neighbors)(struct __pyx_obj_5_soya__Cal3dSubMesh *,PyObject *,float (*)));
};
static struct __pyx_vtabstruct_5_soya__Cal3dSubMesh *__pyx_vtabptr_5_soya__Cal3dSubMesh;

static PyTypeObject *__pyx_ptype_5_soya__CObj = 0;
static PyTypeObject *__pyx_ptype_5_soya__Image = 0;
static PyTypeObject *__pyx_ptype_5_soya__Material = 0;
static PyTypeObject *__pyx_ptype_5_soya__Model = 0;
static PyTypeObject *__pyx_ptype_5_soya__SimpleModel = 0;
static PyTypeObject *__pyx_ptype_5_soya__CellShadingModel = 0;
static PyTypeObject *__pyx_ptype_5_soya__TreeModel = 0;
static PyTypeObject *__pyx_ptype_5_soya__ModelData = 0;
static PyTypeObject *__pyx_ptype_5_soya__AnimatedModelData = 0;
static PyTypeObject *__pyx_ptype_5_soya_Position = 0;
static PyTypeObject *__pyx_ptype_5_soya__Point = 0;
static PyTypeObject *__pyx_ptype_5_soya__Vector = 0;
static PyTypeObject *__pyx_ptype_5_soya__Vertex = 0;
static PyTypeObject *__pyx_ptype_5_soya_CoordSyst = 0;
static PyTypeObject *__pyx_ptype_5_soya__Camera = 0;
static PyTypeObject *__pyx_ptype_5_soya__Light = 0;
static PyTypeObject *__pyx_ptype_5_soya__Body = 0;
static PyTypeObject *__pyx_ptype_5_soya__World = 0;
static PyTypeObject *__pyx_ptype_5_soya__Face = 0;
static PyTypeObject *__pyx_ptype_5_soya__AnimatedModel = 0;
static PyTypeObject *__pyx_ptype_5_soya__Sprite = 0;
static PyTypeObject *__pyx_ptype_5_soya__Portal = 0;
static PyTypeObject *__pyx_ptype_5_soya__Terrain = 0;
static PyTypeObject *__pyx_ptype_5_soya__Atmosphere = 0;
static PyTypeObject *__pyx_ptype_5_soya_Renderer = 0;
static PyTypeObject *__pyx_ptype_5_soya_Context = 0;
static PyTypeObject *__pyx_ptype_5_soya_RaypickData = 0;
static PyTypeObject *__pyx_ptype_5_soya_RaypickContext = 0;
static PyTypeObject *__pyx_ptype_5_soya_MainLoop = 0;
static PyTypeObject *__pyx_ptype_5_soya_Glyph = 0;
static PyTypeObject *__pyx_ptype_5_soya__Font = 0;
static PyTypeObject *__pyx_ptype_5_soya_ModelBuilder = 0;
static PyTypeObject *__pyx_ptype_5_soya_Traveling = 0;
static PyTypeObject *__pyx_ptype_5_soya__TravelingCamera = 0;
static PyTypeObject *__pyx_ptype_5_soya__Deform = 0;
static PyTypeObject *__pyx_ptype_5_soya__NoBackgroundAtmosphere = 0;
static PyTypeObject *__pyx_ptype_5_soya__SkyAtmosphere = 0;
static PyTypeObject *__pyx_ptype_5_soya_PythonCoordSyst = 0;
static PyTypeObject *__pyx_ptype_5_soya_CoordSystState = 0;
static PyTypeObject *__pyx_ptype_5_soya__FixTraveling = 0;
static PyTypeObject *__pyx_ptype_5_soya__ThirdPersonTraveling = 0;
static PyTypeObject *__pyx_ptype_5_soya__PythonMaterial = 0;
static PyTypeObject *__pyx_ptype_5_soya__CylinderSprite = 0;
static PyTypeObject *__pyx_ptype_5_soya__Bonus = 0;
static PyTypeObject *__pyx_ptype_5_soya__Particles = 0;
static PyTypeObject *__pyx_ptype_5_soya_FlagFirework = 0;
static PyTypeObject *__pyx_ptype_5_soya_SimpleModelBuilder = 0;
static PyTypeObject *__pyx_ptype_5_soya_TreeModelBuilder = 0;
static PyTypeObject *__pyx_ptype_5_soya_CellShadingModelBuilder = 0;
static PyTypeObject *__pyx_ptype_5_soya__Cal3dSubMesh = 0;

/* Declarations from _ode */

staticforward PyTypeObject __pyx_type_4_ode_Mass;

struct __pyx_obj_4_ode_Mass {
  PyObject_HEAD
  dMass _mass;
};

staticforward PyTypeObject __pyx_type_4_ode_GeomObject;

struct __pyx_obj_4_ode_GeomObject {
  struct __pyx_obj_5_soya_CoordSyst __pyx_base;
  dGeomID gid;
  struct __pyx_obj_4_ode_SpaceBase *space;
  struct __pyx_obj_4_ode__Body *_body;
  struct __pyx_obj_4_ode__World *world;
};

struct __pyx_vtabstruct_4_ode_GeomObject {
  struct __pyx_vtabstruct_5_soya_CoordSyst __pyx_base;
  float ((*_point_depth)(struct __pyx_obj_4_ode_GeomObject *,float ,float ,float ));
};
static struct __pyx_vtabstruct_4_ode_GeomObject *__pyx_vtabptr_4_ode_GeomObject;

staticforward PyTypeObject __pyx_type_4_ode_Contact;

struct __pyx_obj_4_ode_Contact {
  PyObject_HEAD
  dContact _contact;
};

staticforward PyTypeObject __pyx_type_4_ode__Body;

struct __pyx_obj_4_ode__Body {
  struct __pyx_obj_5_soya__World __pyx_base;
  dBodyID _bid;
  GLfloat (_q[4]);
  GLfloat (_p[4]);
  float _t;
  int _valid;
  PyObject *joints;
};

struct __pyx_vtabstruct_4_ode__Body {
  struct __pyx_vtabstruct_5_soya__World __pyx_base;
  void ((*_add_joint)(struct __pyx_obj_4_ode__Body *,struct __pyx_obj_4_ode_Joint *));
  void ((*_remove_joint)(struct __pyx_obj_4_ode__Body *,struct __pyx_obj_4_ode_Joint *));
};
static struct __pyx_vtabstruct_4_ode__Body *__pyx_vtabptr_4_ode__Body;

staticforward PyTypeObject __pyx_type_4_ode__World;

struct __pyx_obj_4_ode__World {
  struct __pyx_obj_5_soya__World __pyx_base;
  double steptime;
  dWorldID _wid;
};

struct __pyx_vtabstruct_4_ode__World {
  struct __pyx_vtabstruct_5_soya__World __pyx_base;
};
static struct __pyx_vtabstruct_4_ode__World *__pyx_vtabptr_4_ode__World;

staticforward PyTypeObject __pyx_type_4_ode_Joint;

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

struct __pyx_vtabstruct_4_ode_Joint {
  void ((*_setParam)(struct __pyx_obj_4_ode_Joint *,int ,dReal ));
  dReal ((*_getParam)(struct __pyx_obj_4_ode_Joint *,int ));
};
static struct __pyx_vtabstruct_4_ode_Joint *__pyx_vtabptr_4_ode_Joint;

staticforward PyTypeObject __pyx_type_4_ode_JointGroup;

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

staticforward PyTypeObject __pyx_type_4_ode_BallJoint;

struct __pyx_obj_4_ode_BallJoint {
  struct __pyx_obj_4_ode_Joint __pyx_base;
};

struct __pyx_vtabstruct_4_ode_BallJoint {
  struct __pyx_vtabstruct_4_ode_Joint __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_BallJoint *__pyx_vtabptr_4_ode_BallJoint;

staticforward PyTypeObject __pyx_type_4_ode_HingeJoint;

struct __pyx_obj_4_ode_HingeJoint {
  struct __pyx_obj_4_ode_Joint __pyx_base;
};

struct __pyx_vtabstruct_4_ode_HingeJoint {
  struct __pyx_vtabstruct_4_ode_Joint __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_HingeJoint *__pyx_vtabptr_4_ode_HingeJoint;

staticforward PyTypeObject __pyx_type_4_ode_SliderJoint;

struct __pyx_obj_4_ode_SliderJoint {
  struct __pyx_obj_4_ode_Joint __pyx_base;
};

struct __pyx_vtabstruct_4_ode_SliderJoint {
  struct __pyx_vtabstruct_4_ode_Joint __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_SliderJoint *__pyx_vtabptr_4_ode_SliderJoint;

staticforward PyTypeObject __pyx_type_4_ode_UniversalJoint;

struct __pyx_obj_4_ode_UniversalJoint {
  struct __pyx_obj_4_ode_Joint __pyx_base;
};

struct __pyx_vtabstruct_4_ode_UniversalJoint {
  struct __pyx_vtabstruct_4_ode_Joint __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_UniversalJoint *__pyx_vtabptr_4_ode_UniversalJoint;

staticforward PyTypeObject __pyx_type_4_ode_Hinge2Joint;

struct __pyx_obj_4_ode_Hinge2Joint {
  struct __pyx_obj_4_ode_Joint __pyx_base;
};

struct __pyx_vtabstruct_4_ode_Hinge2Joint {
  struct __pyx_vtabstruct_4_ode_Joint __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_Hinge2Joint *__pyx_vtabptr_4_ode_Hinge2Joint;

staticforward PyTypeObject __pyx_type_4_ode_FixedJoint;

struct __pyx_obj_4_ode_FixedJoint {
  struct __pyx_obj_4_ode_Joint __pyx_base;
};

struct __pyx_vtabstruct_4_ode_FixedJoint {
  struct __pyx_vtabstruct_4_ode_Joint __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_FixedJoint *__pyx_vtabptr_4_ode_FixedJoint;

staticforward PyTypeObject __pyx_type_4_ode_ContactJoint;

struct __pyx_obj_4_ode_ContactJoint {
  struct __pyx_obj_4_ode_Joint __pyx_base;
};

struct __pyx_vtabstruct_4_ode_ContactJoint {
  struct __pyx_vtabstruct_4_ode_Joint __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_ContactJoint *__pyx_vtabptr_4_ode_ContactJoint;

staticforward PyTypeObject __pyx_type_4_ode_AMotor;

struct __pyx_obj_4_ode_AMotor {
  struct __pyx_obj_4_ode_Joint __pyx_base;
};

struct __pyx_vtabstruct_4_ode_AMotor {
  struct __pyx_vtabstruct_4_ode_Joint __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_AMotor *__pyx_vtabptr_4_ode_AMotor;

staticforward PyTypeObject __pyx_type_4_ode_SpaceBase;

struct __pyx_obj_4_ode_SpaceBase {
  struct __pyx_obj_4_ode_GeomObject __pyx_base;
  dSpaceID sid;
  PyObject *geoms;
};

struct __pyx_vtabstruct_4_ode_SpaceBase {
  struct __pyx_vtabstruct_4_ode_GeomObject __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_SpaceBase *__pyx_vtabptr_4_ode_SpaceBase;

staticforward PyTypeObject __pyx_type_4_ode__TriMesh;

struct __pyx_obj_4_ode__TriMesh {
  struct __pyx_obj_4_ode_GeomObject __pyx_base;
  dTriMeshDataID _data;
  double (_last_transformation[16]);
  int _colliding;
};

struct __pyx_vtabstruct_4_ode__TriMesh {
  struct __pyx_vtabstruct_4_ode_GeomObject __pyx_base;
  void ((*_set_last_transformation)(struct __pyx_obj_4_ode__TriMesh *));
};
static struct __pyx_vtabstruct_4_ode__TriMesh *__pyx_vtabptr_4_ode__TriMesh;

staticforward PyTypeObject __pyx_type_4_ode_SimpleSpace;

struct __pyx_obj_4_ode_SimpleSpace {
  struct __pyx_obj_4_ode_SpaceBase __pyx_base;
};

struct __pyx_vtabstruct_4_ode_SimpleSpace {
  struct __pyx_vtabstruct_4_ode_SpaceBase __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_SimpleSpace *__pyx_vtabptr_4_ode_SimpleSpace;

staticforward PyTypeObject __pyx_type_4_ode_HashSpace;

struct __pyx_obj_4_ode_HashSpace {
  struct __pyx_obj_4_ode_SpaceBase __pyx_base;
};

struct __pyx_vtabstruct_4_ode_HashSpace {
  struct __pyx_vtabstruct_4_ode_SpaceBase __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_HashSpace *__pyx_vtabptr_4_ode_HashSpace;

staticforward PyTypeObject __pyx_type_4_ode_GeomSphere;

struct __pyx_obj_4_ode_GeomSphere {
  struct __pyx_obj_4_ode_GeomObject __pyx_base;
};

struct __pyx_vtabstruct_4_ode_GeomSphere {
  struct __pyx_vtabstruct_4_ode_GeomObject __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_GeomSphere *__pyx_vtabptr_4_ode_GeomSphere;

staticforward PyTypeObject __pyx_type_4_ode_GeomBox;

struct __pyx_obj_4_ode_GeomBox {
  struct __pyx_obj_4_ode_GeomObject __pyx_base;
};

struct __pyx_vtabstruct_4_ode_GeomBox {
  struct __pyx_vtabstruct_4_ode_GeomObject __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_GeomBox *__pyx_vtabptr_4_ode_GeomBox;

staticforward PyTypeObject __pyx_type_4_ode_GeomPlane;

struct __pyx_obj_4_ode_GeomPlane {
  struct __pyx_obj_4_ode_GeomObject __pyx_base;
};

struct __pyx_vtabstruct_4_ode_GeomPlane {
  struct __pyx_vtabstruct_4_ode_GeomObject __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_GeomPlane *__pyx_vtabptr_4_ode_GeomPlane;

staticforward PyTypeObject __pyx_type_4_ode_GeomCCylinder;

struct __pyx_obj_4_ode_GeomCCylinder {
  struct __pyx_obj_4_ode_GeomObject __pyx_base;
};

struct __pyx_vtabstruct_4_ode_GeomCCylinder {
  struct __pyx_vtabstruct_4_ode_GeomObject __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_GeomCCylinder *__pyx_vtabptr_4_ode_GeomCCylinder;

staticforward PyTypeObject __pyx_type_4_ode_GeomRay;

struct __pyx_obj_4_ode_GeomRay {
  struct __pyx_obj_4_ode_GeomObject __pyx_base;
};

struct __pyx_vtabstruct_4_ode_GeomRay {
  struct __pyx_vtabstruct_4_ode_GeomObject __pyx_base;
};
static struct __pyx_vtabstruct_4_ode_GeomRay *__pyx_vtabptr_4_ode_GeomRay;

staticforward PyTypeObject __pyx_type_4_ode__Terrain;

struct __pyx_obj_4_ode__Terrain {
  struct __pyx_obj_4_ode_GeomObject __pyx_base;
  struct __pyx_obj_5_soya__Terrain *_terrain;
};

struct __pyx_vtabstruct_4_ode__Terrain {
  struct __pyx_vtabstruct_4_ode_GeomObject __pyx_base;
  void ((*_get_aabb)(struct __pyx_obj_4_ode__Terrain *,dReal (*)));
  int ((*_collide_cell)(struct __pyx_obj_4_ode__Terrain *,int ,int ,dGeomID ,dGeomID ,int ,int ,dContactGeom (*),int ));
  int ((*_collide)(struct __pyx_obj_4_ode__Terrain *,dGeomID ,dGeomID ,int ,dContactGeom (*),int ));
};
static struct __pyx_vtabstruct_4_ode__Terrain *__pyx_vtabptr_4_ode__Terrain;

staticforward PyTypeObject __pyx_type_4_ode__GeomModel;

struct __pyx_obj_4_ode__GeomModel {
  struct __pyx_obj_4_ode__TriMesh __pyx_base;
  struct __pyx_obj_5_soya__SimpleModel *model;
  float (*_normals);
  int (*_indices);
};

struct __pyx_vtabstruct_4_ode__GeomModel {
  struct __pyx_vtabstruct_4_ode__TriMesh __pyx_base;
};
static struct __pyx_vtabstruct_4_ode__GeomModel *__pyx_vtabptr_4_ode__GeomModel;

staticforward PyTypeObject __pyx_type_4_ode__GeomTerrain;

struct __pyx_obj_4_ode__GeomTerrain {
  struct __pyx_obj_4_ode__TriMesh __pyx_base;
  struct __pyx_obj_5_soya__Terrain *terrain;
  float (*_normals);
  int (*_indices);
};

struct __pyx_vtabstruct_4_ode__GeomTerrain {
  struct __pyx_vtabstruct_4_ode__TriMesh __pyx_base;
};
static struct __pyx_vtabstruct_4_ode__GeomTerrain *__pyx_vtabptr_4_ode__GeomTerrain;

static PyTypeObject *__pyx_ptype_4_ode_Mass = 0;
static PyTypeObject *__pyx_ptype_4_ode_GeomObject = 0;
static PyTypeObject *__pyx_ptype_4_ode_Contact = 0;
static PyTypeObject *__pyx_ptype_4_ode__Body = 0;
static PyTypeObject *__pyx_ptype_4_ode__World = 0;
static PyTypeObject *__pyx_ptype_4_ode_Joint = 0;
static PyTypeObject *__pyx_ptype_4_ode_JointGroup = 0;
static PyTypeObject *__pyx_ptype_4_ode_BallJoint = 0;
static PyTypeObject *__pyx_ptype_4_ode_HingeJoint = 0;
static PyTypeObject *__pyx_ptype_4_ode_SliderJoint = 0;
static PyTypeObject *__pyx_ptype_4_ode_UniversalJoint = 0;
static PyTypeObject *__pyx_ptype_4_ode_Hinge2Joint = 0;
static PyTypeObject *__pyx_ptype_4_ode_FixedJoint = 0;
static PyTypeObject *__pyx_ptype_4_ode_ContactJoint = 0;
static PyTypeObject *__pyx_ptype_4_ode_AMotor = 0;
static PyTypeObject *__pyx_ptype_4_ode_SpaceBase = 0;
static PyTypeObject *__pyx_ptype_4_ode__TriMesh = 0;
static PyTypeObject *__pyx_ptype_4_ode_SimpleSpace = 0;
static PyTypeObject *__pyx_ptype_4_ode_HashSpace = 0;
static PyTypeObject *__pyx_ptype_4_ode_GeomSphere = 0;
static PyTypeObject *__pyx_ptype_4_ode_GeomBox = 0;
static PyTypeObject *__pyx_ptype_4_ode_GeomPlane = 0;
static PyTypeObject *__pyx_ptype_4_ode_GeomCCylinder = 0;
static PyTypeObject *__pyx_ptype_4_ode_GeomRay = 0;
static PyTypeObject *__pyx_ptype_4_ode__Terrain = 0;
static PyTypeObject *__pyx_ptype_4_ode__GeomModel = 0;
static PyTypeObject *__pyx_ptype_4_ode__GeomTerrain = 0;
static dGeomID __pyx_v_4_ode__terrain_plane;
static dGeomID __pyx_v_4_ode__terrain_ray;
static dGeomClass __pyx_v_4_ode_dTerrainGeomClass;
static int __pyx_v_4_ode_dTerrainClass;
static struct __pyx_obj_4_ode__World *__pyx_k34;
static struct __pyx_obj_4_ode__World *__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 struct __pyx_obj_5_soya_CoordSyst *__pyx_k51;
static struct __pyx_obj_4_ode_SpaceBase *__pyx_k52;
static struct __pyx_obj_5_soya_CoordSyst *__pyx_k53;
static struct __pyx_obj_4_ode_SpaceBase *__pyx_k54;
static struct __pyx_obj_5_soya__World *__pyx_k55;
static struct __pyx_obj_4_ode_SpaceBase *__pyx_k56;
static struct __pyx_obj_5_soya__World *__pyx_k57;
static struct __pyx_obj_4_ode_SpaceBase *__pyx_k58;
static PyObject *__pyx_k59;
static struct __pyx_obj_5_soya__World *__pyx_k60;
static struct __pyx_obj_4_ode_SpaceBase *__pyx_k61;
static PyObject *__pyx_k62;
static struct __pyx_obj_5_soya__World *__pyx_k63;
static struct __pyx_obj_4_ode_SpaceBase *__pyx_k64;
static PyObject *__pyx_k65;
static PyObject *__pyx_k66;
static struct __pyx_obj_5_soya__World *__pyx_k67;
static struct __pyx_obj_4_ode_SpaceBase *__pyx_k68;
static PyObject *__pyx_k69;
static PyObject *__pyx_k70;
static struct __pyx_obj_5_soya__World *__pyx_k71;
static struct __pyx_obj_4_ode_SpaceBase *__pyx_k72;
static PyObject *__pyx_k73;
static struct __pyx_obj_4_ode_SpaceBase *__pyx_k74;
static struct __pyx_obj_4_ode_SpaceBase *__pyx_k75;
static struct __pyx_obj_5_soya__SimpleModel *__pyx_k76;
static struct __pyx_obj_4_ode_SpaceBase *__pyx_k77;
static int __pyx_k78;
static void (__pyx_f_4_ode_collide_callback(void (*),dGeomID ,dGeomID )); /*proto*/
static int (__pyx_f_4_ode_collide_edge(GLfloat (*),GLfloat (*),GLfloat (*),GLfloat (*),GLfloat (*),dGeomID ,dGeomID ,int ,int ,dContactGeom (*))); /*proto*/
static void (__pyx_f_4_ode_TerrainGetAABB(dGeomID ,dReal (*))); /*proto*/
static int (__pyx_f_4_ode_TerrainCollide(dGeomID ,dGeomID ,int ,dContactGeom (*),int )); /*proto*/
static dColliderFn (*(__pyx_f_4_ode_TerrainGetColliderFn(int ))); /*proto*/
static int (__pyx_f_4_ode_TerrainAABBTest(dGeomID ,dGeomID ,dReal (*))); /*proto*/

/* Implementation of _ode */

static char (__pyx_k1[]) = "The position of the contact point";
static char (__pyx_k2[]) = "The normal of the contact geom";
static char (__pyx_k3[]) = "The depth of the contact point";
static char (__pyx_k4[]) = "The first intersecting geom";
static char (__pyx_k5[]) = "The second intersecting geom";
static char (__pyx_k6[]) = "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 char (__pyx_k7[]) = "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 char (__pyx_k8[]) = "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 char (__pyx_k9[]) = "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 char (__pyx_k10[]) = "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 char (__pyx_k11[]) = "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 char (__pyx_k12[]) = "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 char (__pyx_k13[]) = "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 char (__pyx_k14[]) = "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 char (__pyx_k15[]) = "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 char (__pyx_k16[]) = "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 char (__pyx_k17[]) = "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 char (__pyx_k18[]) = "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 char (__pyx_k19[]) = "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 char (__pyx_k20[]) = "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 char (__pyx_k21[]) = "setAxis(axis)\n\n				Set the hinge axis.\n\n				@param axis: Hinge axis\n				@type axis: 3-sequence of floats\n				";
static char (__pyx_k22[]) = "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 char (__pyx_k23[]) = "getAngleRate() -> float\n\n				Get the time derivative of the angle.\n				";
static char (__pyx_k24[]) = "setAxis(axis)\n\n				Set the slider axis parameter.\n\n				@param axis: Slider axis\n				@type axis: 3-sequence of floats        \n				";
static char (__pyx_k25[]) = "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 char (__pyx_k26[]) = "getPositionRate() -> float\n\n				Get the time derivative of the position.\n				";
static char (__pyx_k27[]) = "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 char (__pyx_k28[]) = "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 char (__pyx_k29[]) = "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 char (__pyx_k30[]) = "getAngle1Rate() -> float\n\n				Get the time derivative of the first hinge-2 angle.\n				";
static char (__pyx_k31[]) = "getAngle2Rate() -> float\n\n				Get the time derivative of the second hinge-2 angle.\n				";
static char (__pyx_k32[]) = "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 char (__pyx_k33[]) = "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__soya;
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_collide;
static PyObject *__pyx_n_CloseODE;
static PyObject *__pyx_n_environment;

static PyObject *__pyx_k33p;

static int __pyx_f_4_ode_4Mass___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_4Mass___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 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_args, &__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_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/mass.pyx":27 */
  dMassSetZero((&((struct __pyx_obj_4_ode_Mass *)__pyx_v_self)->_mass));

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Mass.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_self);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_4Mass_setZero(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_4Mass_setZero[] = "setZero()\n\n				Set all the mass parameters to zero.";
static PyObject *__pyx_f_4_ode_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":33 */
  dMassSetZero((&((struct __pyx_obj_4_ode_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_4_ode_4Mass_setParameters(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":61 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_mass); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_cgx); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_cgy); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_cgz); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_5 = PyFloat_AsDouble(__pyx_v_I11); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_6 = PyFloat_AsDouble(__pyx_v_I22); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_7 = PyFloat_AsDouble(__pyx_v_I33); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_8 = PyFloat_AsDouble(__pyx_v_I12); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_9 = PyFloat_AsDouble(__pyx_v_I13); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_10 = PyFloat_AsDouble(__pyx_v_I23); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  dMassSetParameters((&((struct __pyx_obj_4_ode_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_4_ode_4Mass_setSphere(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":74 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_density); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
  dMassSetSphere((&((struct __pyx_obj_4_ode_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_4_ode_4Mass_setCappedCylinder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":96 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_density); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_v_direction); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_r); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_h); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
  dMassSetCappedCylinder((&((struct __pyx_obj_4_ode_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_4_ode_4Mass_setCylinder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":117 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_density); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_v_direction); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_r); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_h); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
  dMassSetCylinder((&((struct __pyx_obj_4_ode_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_4_ode_4Mass_setBox(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":136 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_density); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;}
  __pyx_2 = PyFloat_AsDouble(__pyx_v_lx); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;}
  __pyx_3 = PyFloat_AsDouble(__pyx_v_ly); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;}
  __pyx_4 = PyFloat_AsDouble(__pyx_v_lz); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;}
  dMassSetBox((&((struct __pyx_obj_4_ode_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_4_ode_4Mass_adjust(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":150 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_newmass); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
  dMassAdjust((&((struct __pyx_obj_4_ode_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_4_ode_4Mass_translate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":162 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; 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 = 162; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; 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 = 162; 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 = 162; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; 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 = 162; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dMassTranslate((&((struct __pyx_obj_4_ode_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_4_ode_4Mass_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_4Mass_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode_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_4_ode_Mass, 1, "b")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/mass.pyx":180 */
  dMassAdd((&((struct __pyx_obj_4_ode_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_k82p;
static PyObject *__pyx_k83p;

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

static PyObject *__pyx_f_4_ode_4Mass___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_f_4_ode_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":183 */
  if (PyObject_Cmp(__pyx_v_name, __pyx_n_mass, &__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_4_ode_Mass *)__pyx_v_self)->_mass.mass); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; 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 = 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_4_ode_Mass *)__pyx_v_self)->_mass.c[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
    __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Mass *)__pyx_v_self)->_mass.c[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
    __pyx_4 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Mass *)__pyx_v_self)->_mass.c[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_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 = 187; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/mass.pyx":188 */
    __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Mass *)__pyx_v_self)->_mass.I[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
    __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Mass *)__pyx_v_self)->_mass.I[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
    __pyx_4 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Mass *)__pyx_v_self)->_mass.I[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; 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_4_ode_Mass *)__pyx_v_self)->_mass.I[4])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;}
    __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Mass *)__pyx_v_self)->_mass.I[5])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;}
    __pyx_4 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Mass *)__pyx_v_self)->_mass.I[6])); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;}
    __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; 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_4_ode_Mass *)__pyx_v_self)->_mass.I[8])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
    __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Mass *)__pyx_v_self)->_mass.I[9])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
    __pyx_4 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Mass *)__pyx_v_self)->_mass.I[10])); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
    __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; 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 = 188; 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":192 */
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;}
    __pyx_4 = PyNumber_Add(__pyx_k82p, __pyx_v_name); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;}
    __pyx_5 = PyNumber_Add(__pyx_4, __pyx_k83p); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; 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 = 192; 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_k86p;
static PyObject *__pyx_k88p;
static PyObject *__pyx_k89p;
static PyObject *__pyx_k90p;

static char (__pyx_k86[]) = "Use the setParameter() method to change c";
static char (__pyx_k88[]) = "Use the setParameter() method to change I";
static char (__pyx_k89[]) = "Mass object has no attribute '";
static char (__pyx_k90[]) = "\'";

static int __pyx_f_4_ode_4Mass___setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /*proto*/
static int __pyx_f_4_ode_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":195 */
  if (PyObject_Cmp(__pyx_v_name, __pyx_n_mass, &__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 = PyObject_GetAttr(__pyx_v_self, __pyx_n_adjust); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; 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 = 196; 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 = 197; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
  if (__pyx_1) {

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

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

    /* "/home/jiba/src/soya/ode/mass.pyx":202 */
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;}
    __pyx_2 = PyNumber_Add(__pyx_k89p, __pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;}
    __pyx_3 = PyNumber_Add(__pyx_2, __pyx_k90p); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; 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 = 202; 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_4_ode_4Mass___add__(PyObject *__pyx_v_self, PyObject *__pyx_v_b); /*proto*/
static PyObject *__pyx_f_4_ode_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_4_ode_Mass, 1, "b")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;}

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

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

static PyObject *__pyx_f_4_ode_4Mass___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_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":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_4_ode_Mass *)__pyx_v_self)->_mass.mass); 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_m);
  __pyx_v_m = __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_4_ode_Mass *)__pyx_v_self)->_mass.c[0])); 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_sc0);
  __pyx_v_sc0 = __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_4_ode_Mass *)__pyx_v_self)->_mass.c[1])); 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_sc1);
  __pyx_v_sc1 = __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_4_ode_Mass *)__pyx_v_self)->_mass.c[2])); 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_sc2);
  __pyx_v_sc2 = __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_4_ode_Mass *)__pyx_v_self)->_mass.I[0])); 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_I11);
  __pyx_v_I11 = __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_4_ode_Mass *)__pyx_v_self)->_mass.I[5])); 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_I22);
  __pyx_v_I22 = __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_4_ode_Mass *)__pyx_v_self)->_mass.I[10])); 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_I33);
  __pyx_v_I33 = __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_4_ode_Mass *)__pyx_v_self)->_mass.I[1])); 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_I12);
  __pyx_v_I12 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/jiba/src/soya/ode/mass.pyx":217 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Mass *)__pyx_v_self)->_mass.I[2])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; 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 = 217; 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":218 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Mass *)__pyx_v_self)->_mass.I[6])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; 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 = 218; 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":219 */
  __pyx_1 = PyTuple_New(10); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; 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_k91p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; 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_4_ode_7Contact___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_7Contact___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  static char *__pyx_argnames[] = {0};
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, &__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_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF(__pyx_v_self);

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

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

  /* "/home/jiba/src/soya/ode/contact.pyx":28 */
  ((struct __pyx_obj_4_ode_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_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_self);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_4mode___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_4mode___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":32 */
  __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.mode); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; 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.mode.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_4mode___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_m); /*proto*/
static int __pyx_f_4_ode_7Contact_4mode___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_m) {
  int __pyx_v_m;
  int __pyx_r;
  Py_INCREF(__pyx_v_self);
  __pyx_v_m = PyInt_AsLong(__pyx_arg_m); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/contact.pyx":35 */
  ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.mode = __pyx_v_m;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Contact.mode.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_2mu___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_2mu___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":39 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.mu); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __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.Contact.mu.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_2mu___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_mu); /*proto*/
static int __pyx_f_4_ode_7Contact_2mu___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_mu) {
  double __pyx_v_mu;
  int __pyx_r;
  Py_INCREF(__pyx_v_self);
  __pyx_v_mu = PyFloat_AsDouble(__pyx_arg_mu); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 41; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/contact.pyx":42 */
  ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.mu = __pyx_v_mu;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Contact.mu.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_3mu2___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_3mu2___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":46 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.mu2); 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.mu2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_3mu2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_mu); /*proto*/
static int __pyx_f_4_ode_7Contact_3mu2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_mu) {
  double __pyx_v_mu;
  int __pyx_r;
  Py_INCREF(__pyx_v_self);
  __pyx_v_mu = PyFloat_AsDouble(__pyx_arg_mu); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 48; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/contact.pyx":49 */
  ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.mu2 = __pyx_v_mu;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Contact.mu2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_6bounce___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_6bounce___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

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

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

static int __pyx_f_4_ode_7Contact_6bounce___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_b); /*proto*/
static int __pyx_f_4_ode_7Contact_6bounce___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_b) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_b);

  /* "/home/jiba/src/soya/ode/contact.pyx":56 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_b); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 56; goto __pyx_L1;}
  ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.bounce = __pyx_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Contact.bounce.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_b);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_10bounce_vel___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_10bounce_vel___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":60 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.bounce_vel); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 60; 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.bounce_vel.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_10bounce_vel___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_bv); /*proto*/
static int __pyx_f_4_ode_7Contact_10bounce_vel___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_bv) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_bv);

  /* "/home/jiba/src/soya/ode/contact.pyx":63 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_bv); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; goto __pyx_L1;}
  ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.bounce_vel = __pyx_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Contact.bounce_vel.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_bv);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_8soft_erp___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_8soft_erp___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":67 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.soft_erp); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; 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.soft_erp.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_8soft_erp___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_erp); /*proto*/
static int __pyx_f_4_ode_7Contact_8soft_erp___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_erp) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_erp);

  /* "/home/jiba/src/soya/ode/contact.pyx":70 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_erp); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; goto __pyx_L1;}
  ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.soft_erp = __pyx_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Contact.soft_erp.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_erp);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_8soft_cfm___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_8soft_cfm___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":74 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.soft_cfm); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __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.Contact.soft_cfm.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_8soft_cfm___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_cfm); /*proto*/
static int __pyx_f_4_ode_7Contact_8soft_cfm___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_cfm) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_cfm);

  /* "/home/jiba/src/soya/ode/contact.pyx":77 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_cfm); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 77; goto __pyx_L1;}
  ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.soft_cfm = __pyx_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Contact.soft_cfm.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_cfm);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_7motion1___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_7motion1___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":81 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.motion1); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; 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.motion1.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_7motion1___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_m); /*proto*/
static int __pyx_f_4_ode_7Contact_7motion1___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_m);

  /* "/home/jiba/src/soya/ode/contact.pyx":84 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_m); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; goto __pyx_L1;}
  ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.motion1 = __pyx_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Contact.motion1.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_m);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_7motion2___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_7motion2___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":88 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.motion2); 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.motion2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_7motion2___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_m); /*proto*/
static int __pyx_f_4_ode_7Contact_7motion2___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_m);

  /* "/home/jiba/src/soya/ode/contact.pyx":91 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_m); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; goto __pyx_L1;}
  ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.motion2 = __pyx_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Contact.motion2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_m);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_5slip1___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_5slip1___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":95 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.slip1); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 95; 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.slip1.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_5slip1___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_s); /*proto*/
static int __pyx_f_4_ode_7Contact_5slip1___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_s) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_s);

  /* "/home/jiba/src/soya/ode/contact.pyx":98 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_s); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; goto __pyx_L1;}
  ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.slip1 = __pyx_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Contact.slip1.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_s);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_5slip2___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_5slip2___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":102 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.slip2); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __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.Contact.slip2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_5slip2___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_s); /*proto*/
static int __pyx_f_4_ode_7Contact_5slip2___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_s) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_s);

  /* "/home/jiba/src/soya/ode/contact.pyx":105 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_s); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 105; goto __pyx_L1;}
  ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.surface.slip2 = __pyx_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Contact.slip2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_s);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_3pos___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_3pos___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":110 */
  __pyx_1 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.geom.pos[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 110; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.geom.pos[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 110; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.geom.pos[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 110; 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.Contact.pos.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_3pos___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_pos); /*proto*/
static int __pyx_f_4_ode_7Contact_3pos___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_pos) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_pos);

  /* "/home/jiba/src/soya/ode/contact.pyx":114 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 114; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 114; 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 = 114; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  (((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.geom.pos[0]) = __pyx_3;

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

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

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode.Contact.pos.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_pos);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_6normal___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_6normal___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":121 */
  __pyx_1 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.geom.normal[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 121; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.geom.normal[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 121; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.geom.normal[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 122; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 121; 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.Contact.normal.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_6normal___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_normal); /*proto*/
static int __pyx_f_4_ode_7Contact_6normal___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_normal) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_normal);

  /* "/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_normal, __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_4_ode_Contact *)__pyx_v_self)->_contact.geom.normal[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_normal, __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_4_ode_Contact *)__pyx_v_self)->_contact.geom.normal[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_normal, __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_4_ode_Contact *)__pyx_v_self)->_contact.geom.normal[2]) = __pyx_3;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode.Contact.normal.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_normal);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_5depth___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_5depth___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":132 */
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.geom.depth); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; 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.depth.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_5depth___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_depth); /*proto*/
static int __pyx_f_4_ode_7Contact_5depth___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_depth) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_depth);

  /* "/home/jiba/src/soya/ode/contact.pyx":135 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_depth); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; goto __pyx_L1;}
  ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.geom.depth = __pyx_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Contact.depth.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_depth);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_2g1___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_2g1___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":140 */
  __pyx_1 = (PyObject *)dGeomGetData(((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.geom.g1);
  Py_INCREF((PyObject *)__pyx_1);
  __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.g1.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_2g1___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_g1); /*proto*/
static int __pyx_f_4_ode_7Contact_2g1___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_g1) {
  int __pyx_r;
  int __pyx_1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_g1);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g1), __pyx_ptype_4_ode_GeomObject, 1, "g1")) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 142; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/contact.pyx":143 */
  __pyx_1 = __pyx_v_g1 == Py_None;
  if (__pyx_1) {

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

    /* "/home/jiba/src/soya/ode/contact.pyx":146 */
    ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.geom.g1 = ((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_g1)->gid;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Contact.g1.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_g1);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7Contact_2g2___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7Contact_2g2___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/contact.pyx":151 */
  __pyx_1 = (PyObject *)dGeomGetData(((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.geom.g2);
  Py_INCREF((PyObject *)__pyx_1);
  __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.g2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7Contact_2g2___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_g2); /*proto*/
static int __pyx_f_4_ode_7Contact_2g2___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_g2) {
  int __pyx_r;
  int __pyx_1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_g2);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g2), __pyx_ptype_4_ode_GeomObject, 1, "g2")) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 153; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/contact.pyx":154 */
  __pyx_1 = __pyx_v_g2 == Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/contact.pyx":155 */
    ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.geom.g2 = 0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/contact.pyx":157 */
    ((struct __pyx_obj_4_ode_Contact *)__pyx_v_self)->_contact.geom.g2 = ((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_g2)->gid;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.Contact.g2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_g2);
  return __pyx_r;
}

static int __pyx_f_4_ode_6_World___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_6_World___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 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_args, &__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_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/world.pyx":23 */
  ((struct __pyx_obj_4_ode__World *)__pyx_v_self)->steptime = 0.030;

  /* "/home/jiba/src/soya/ode/world.pyx":24 */
  ((struct __pyx_obj_4_ode__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_XDECREF(__pyx_v_args);
  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_k92p;

static char (__pyx_k92[]) = "__dealloc__ ode._World";

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

  /* "/home/jiba/src/soya/ode/world.pyx":31 */
  if (__Pyx_PrintItem(__pyx_k92p) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; goto __pyx_L1;}
  if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/world.pyx":32 */
  __pyx_1 = (((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid != 0);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/world.pyx":33 */
    dWorldDestroy(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid);
    goto __pyx_L2;
  }
  __pyx_L2:;

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

static int __pyx_f_4_ode_6_World_7gravity___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_gravity); /*proto*/
static int __pyx_f_4_ode_6_World_7gravity___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_gravity) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_gravity);

  /* "/home/jiba/src/soya/ode/world.pyx":53 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_gravity, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; 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 = 53; 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 = 53; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_gravity, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; 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 = 53; 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 = 53; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_gravity, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; 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 = 53; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dWorldSetGravity(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode._World.gravity.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_gravity);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_6_World_7gravity___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_6_World_7gravity___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_g;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/world.pyx":57 */
  dWorldGetGravity(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid,__pyx_v_g);

  /* "/home/jiba/src/soya/ode/world.pyx":58 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_g[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_g[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_g[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; 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.gravity.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_6_World_3erp___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_erp); /*proto*/
static int __pyx_f_4_ode_6_World_3erp___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_erp) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_erp);

  /* "/home/jiba/src/soya/ode/world.pyx":71 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_erp); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; goto __pyx_L1;}
  dWorldSetERP(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid,__pyx_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._World.erp.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_erp);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_6_World_3erp___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_6_World_3erp___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/world.pyx":74 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetERP(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __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._World.erp.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_6_World_3cfm___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_cfm); /*proto*/
static int __pyx_f_4_ode_6_World_3cfm___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_cfm) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_cfm);

  /* "/home/jiba/src/soya/ode/world.pyx":88 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_cfm); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; goto __pyx_L1;}
  dWorldSetCFM(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid,__pyx_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._World.cfm.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_cfm);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_6_World_3cfm___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_6_World_3cfm___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/world.pyx":91 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetCFM(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; 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.cfm.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_begin_round;

static PyObject *__pyx_f_4_ode_6_World_begin_round(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_6_World_begin_round[] = "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_4_ode_6_World_begin_round(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;
  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/world.pyx":128 */
  __pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5_soya__World), __pyx_n_begin_round); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 128; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 128; goto __pyx_L1;}
  Py_INCREF((PyObject *)__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 128; 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/world.pyx":131 */
  dWorldQuickStep(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid,((struct __pyx_obj_4_ode__World *)__pyx_v_self)->steptime);

  __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._World.begin_round");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_6_World_24quickstep_num_iterations___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_num); /*proto*/
static int __pyx_f_4_ode_6_World_24quickstep_num_iterations___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_num) {
  int __pyx_r;
  int __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_num);

  /* "/home/jiba/src/soya/ode/world.pyx":149 */
  __pyx_1 = PyInt_AsLong(__pyx_v_num); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; goto __pyx_L1;}
  dWorldSetQuickStepNumIterations(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid,__pyx_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._World.quickstep_num_iterations.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_num);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_6_World_24quickstep_num_iterations___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_6_World_24quickstep_num_iterations___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/world.pyx":152 */
  __pyx_1 = PyInt_FromLong(dWorldGetQuickStepNumIterations(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; 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.quickstep_num_iterations.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_6_World_31contact_max_correcting_velocity___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_vel); /*proto*/
static int __pyx_f_4_ode_6_World_31contact_max_correcting_velocity___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_vel) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_vel);

  /* "/home/jiba/src/soya/ode/world.pyx":166 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_vel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; goto __pyx_L1;}
  dWorldSetContactMaxCorrectingVel(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid,__pyx_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._World.contact_max_correcting_velocity.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_vel);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_6_World_31contact_max_correcting_velocity___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_6_World_31contact_max_correcting_velocity___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/world.pyx":169 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetContactMaxCorrectingVel(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __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._World.contact_max_correcting_velocity.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_6_World_21contact_surface_layer___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_depth); /*proto*/
static int __pyx_f_4_ode_6_World_21contact_surface_layer___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_depth) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_depth);

  /* "/home/jiba/src/soya/ode/world.pyx":185 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_depth); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; goto __pyx_L1;}
  dWorldSetContactSurfaceLayer(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid,__pyx_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._World.contact_surface_layer.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_depth);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_6_World_21contact_surface_layer___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_6_World_21contact_surface_layer___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/world.pyx":188 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetContactSurfaceLayer(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 188; 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.contact_surface_layer.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_6_World_12auto_disable___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_flag); /*proto*/
static int __pyx_f_4_ode_6_World_12auto_disable___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_flag) {
  int __pyx_r;
  int __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_flag);

  /* "/home/jiba/src/soya/ode/world.pyx":199 */
  __pyx_1 = PyInt_AsLong(__pyx_v_flag); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; goto __pyx_L1;}
  dWorldSetAutoDisableFlag(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid,__pyx_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._World.auto_disable.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_flag);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_6_World_12auto_disable___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_6_World_12auto_disable___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/world.pyx":202 */
  __pyx_1 = PyInt_FromLong(dWorldGetAutoDisableFlag(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 202; 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.auto_disable.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_6_World_29auto_disable_linear_threshold___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_threshold); /*proto*/
static int __pyx_f_4_ode_6_World_29auto_disable_linear_threshold___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_threshold) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_threshold);

  /* "/home/jiba/src/soya/ode/world.pyx":214 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_threshold); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; goto __pyx_L1;}
  dWorldSetAutoDisableLinearThreshold(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid,__pyx_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._World.auto_disable_linear_threshold.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_threshold);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_6_World_29auto_disable_linear_threshold___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_6_World_29auto_disable_linear_threshold___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/world.pyx":217 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetAutoDisableLinearThreshold(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; 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.auto_disable_linear_threshold.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_6_World_30auto_disable_angular_threshold___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_threshold); /*proto*/
static int __pyx_f_4_ode_6_World_30auto_disable_angular_threshold___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_threshold) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_threshold);

  /* "/home/jiba/src/soya/ode/world.pyx":229 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_threshold); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 229; goto __pyx_L1;}
  dWorldSetAutoDisableAngularThreshold(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid,__pyx_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._World.auto_disable_angular_threshold.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_threshold);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_6_World_30auto_disable_angular_threshold___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_6_World_30auto_disable_angular_threshold___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/world.pyx":232 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetAutoDisableAngularThreshold(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; 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.auto_disable_angular_threshold.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_6_World_18auto_disable_steps___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_steps); /*proto*/
static int __pyx_f_4_ode_6_World_18auto_disable_steps___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_steps) {
  int __pyx_r;
  int __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_steps);

  /* "/home/jiba/src/soya/ode/world.pyx":243 */
  __pyx_1 = PyInt_AsLong(__pyx_v_steps); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 243; goto __pyx_L1;}
  dWorldSetAutoDisableSteps(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid,__pyx_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._World.auto_disable_steps.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_steps);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_6_World_18auto_disable_steps___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_6_World_18auto_disable_steps___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/world.pyx":246 */
  __pyx_1 = PyInt_FromLong(dWorldGetAutoDisableSteps(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; 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.auto_disable_steps.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_6_World_17auto_disable_time___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_time); /*proto*/
static int __pyx_f_4_ode_6_World_17auto_disable_time___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_time) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_time);

  /* "/home/jiba/src/soya/ode/world.pyx":257 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_time); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; goto __pyx_L1;}
  dWorldSetAutoDisableTime(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid,__pyx_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._World.auto_disable_time.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_time);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_6_World_17auto_disable_time___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_6_World_17auto_disable_time___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/world.pyx":260 */
  __pyx_1 = PyFloat_FromDouble(dWorldGetAutoDisableTime(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 260; 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.auto_disable_time.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_6_World_impulseToForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_6_World_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_4_ode_6_World_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_stepsize);
  Py_INCREF(__pyx_v_impulse);

  /* "/home/jiba/src/soya/ode/world.pyx":277 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_stepsize); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_impulse, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; 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 = 277; 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 = 277; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_impulse, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; 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 = 277; 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 = 277; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_impulse, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; 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 = 277; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  dWorldImpulseToForce(((struct __pyx_obj_4_ode__World *)__pyx_v_self)->_wid,__pyx_1,__pyx_4,__pyx_5,__pyx_6,__pyx_v_force);

  /* "/home/jiba/src/soya/ode/world.pyx":278 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_force[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_force[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; goto __pyx_L1;}
  __pyx_7 = PyFloat_FromDouble((__pyx_v_force[2])); if (!__pyx_7) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; goto __pyx_L1;}
  __pyx_8 = PyTuple_New(3); if (!__pyx_8) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; 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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_stepsize);
  Py_DECREF(__pyx_v_impulse);
  return __pyx_r;
}

static int __pyx_f_4_ode_5_Body___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_5_Body___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__World *__pyx_v_world = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"world",0};
  __pyx_v_world = __pyx_k34;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_world)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_world);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 1, "world")) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/body.pyx":36 */
  __pyx_1 = ((PyObject *)__pyx_v_world) == Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/body.pyx":37 */
    ((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid = 0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/body.pyx":41 */
    ((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid = dBodyCreate(__pyx_v_world->_wid);
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/body.pyx":46 */
  ((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_valid = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._Body.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_world);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static PyObject *__pyx_n___init__;

static int __pyx_f_4_ode_5_Body___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_5_Body___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__World *__pyx_v_world = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"world",0};
  __pyx_v_world = __pyx_k35;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_world)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_world);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 1, "world")) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/body.pyx":49 */
  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->joints);
  ((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->joints = __pyx_1;
  __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/body.pyx":50 */
  __pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5_soya__World), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 50; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 50; goto __pyx_L1;}
  Py_INCREF((PyObject *)__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
  Py_INCREF((PyObject *)((PyObject *)__pyx_v_world));
  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_world));
  __pyx_3 = PySequence_Tuple(__pyx_v_args); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 50; goto __pyx_L1;}
  __pyx_4 = PyNumber_Add(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 50; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_4, __pyx_v_kw); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 50; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  __pyx_r = 0;
  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.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_world);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static PyObject *__pyx_k93p;

static char (__pyx_k93[]) = "__dealloc__ ode._Body";

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

  /* "/home/jiba/src/soya/ode/body.pyx":53 */
  if (__Pyx_PrintItem(__pyx_k93p) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 53; goto __pyx_L1;}
  if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 53; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/body.pyx":54 */
  __pyx_1 = (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid != 0);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/body.pyx":55 */
    dBodyDestroy(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid);
    goto __pyx_L2;
  }
  __pyx_L2:;

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

static PyObject *__pyx_n_append;

static void __pyx_f_4_ode_5_Body__add_joint(struct __pyx_obj_4_ode__Body *__pyx_v_self,struct __pyx_obj_4_ode_Joint *__pyx_v_joint) {
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_joint);

  /* "/home/jiba/src/soya/ode/body.pyx":58 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self->joints, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_joint));
  PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_joint));
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_WriteUnraisable("_ode._Body._add_joint");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_joint);
}

static PyObject *__pyx_n_remove;

static void __pyx_f_4_ode_5_Body__remove_joint(struct __pyx_obj_4_ode__Body *__pyx_v_self,struct __pyx_obj_4_ode_Joint *__pyx_v_joint) {
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_joint);

  /* "/home/jiba/src/soya/ode/body.pyx":61 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self->joints, __pyx_n_remove); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_joint));
  PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_joint));
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_WriteUnraisable("_ode._Body._remove_joint");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_joint);
}

static PyObject *__pyx_f_4_ode_5_Body_begin_round(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_begin_round[] = "Save the previous quaternion and position for interpolation.\n				We can do this in begin_round because the simulation calls\n				begin_round before stepping.";
static PyObject *__pyx_f_4_ode_5_Body_begin_round(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  dReal (*__pyx_v_q);
  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/body.pyx":69 */
  __pyx_v_q = dBodyGetQuaternion(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid);

  /* "/home/jiba/src/soya/ode/body.pyx":70 */
  (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_q[0]) = (__pyx_v_q[1]);

  /* "/home/jiba/src/soya/ode/body.pyx":71 */
  (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_q[1]) = (__pyx_v_q[2]);

  /* "/home/jiba/src/soya/ode/body.pyx":72 */
  (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_q[2]) = (__pyx_v_q[3]);

  /* "/home/jiba/src/soya/ode/body.pyx":73 */
  (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_q[3]) = (__pyx_v_q[0]);

  /* "/home/jiba/src/soya/ode/body.pyx":75 */
  __pyx_v_q = dBodyGetPosition(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid);

  /* "/home/jiba/src/soya/ode/body.pyx":76 */
  (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_p[0]) = (__pyx_v_q[0]);

  /* "/home/jiba/src/soya/ode/body.pyx":77 */
  (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_p[1]) = (__pyx_v_q[1]);

  /* "/home/jiba/src/soya/ode/body.pyx":78 */
  (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_p[2]) = (__pyx_v_q[2]);

  /* "/home/jiba/src/soya/ode/body.pyx":80 */
  ((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_valid = 1;

  /* "/home/jiba/src/soya/ode/body.pyx":81 */
  ((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_t = 0.0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._Body.begin_round");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static char (__pyx_k94[]) = "Update the body\'s matrix after invalidating the root and inverted\n				root matrices. We do this here because all movement methods must\n				call this.";

static void __pyx_f_4_ode_5_Body__invalidate(struct __pyx_obj_4_ode__Body *__pyx_v_self) {
  dMatrix3 __pyx_v_R;
  GLfloat (*__pyx_v_m);
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/body.pyx":119 */
  __pyx_k94;

  /* "/home/jiba/src/soya/ode/body.pyx":126 */
  __pyx_vtabptr_5_soya__World->__pyx_base.__pyx_base._invalidate(((struct __pyx_obj_5_soya_CoordSyst *)__pyx_v_self));

  /* "/home/jiba/src/soya/ode/body.pyx":131 */
  __pyx_v_m = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base._matrix;

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

  /* "/home/jiba/src/soya/ode/body.pyx":133 */
  (__pyx_v_R[1]) = (__pyx_v_m[4]);

  /* "/home/jiba/src/soya/ode/body.pyx":134 */
  (__pyx_v_R[2]) = (__pyx_v_m[8]);

  /* "/home/jiba/src/soya/ode/body.pyx":135 */
  (__pyx_v_R[3]) = 0.0;

  /* "/home/jiba/src/soya/ode/body.pyx":136 */
  (__pyx_v_R[4]) = (__pyx_v_m[1]);

  /* "/home/jiba/src/soya/ode/body.pyx":137 */
  (__pyx_v_R[5]) = (__pyx_v_m[5]);

  /* "/home/jiba/src/soya/ode/body.pyx":138 */
  (__pyx_v_R[6]) = (__pyx_v_m[9]);

  /* "/home/jiba/src/soya/ode/body.pyx":139 */
  (__pyx_v_R[7]) = 0.0;

  /* "/home/jiba/src/soya/ode/body.pyx":140 */
  (__pyx_v_R[8]) = (__pyx_v_m[2]);

  /* "/home/jiba/src/soya/ode/body.pyx":141 */
  (__pyx_v_R[9]) = (__pyx_v_m[6]);

  /* "/home/jiba/src/soya/ode/body.pyx":142 */
  (__pyx_v_R[10]) = (__pyx_v_m[10]);

  /* "/home/jiba/src/soya/ode/body.pyx":143 */
  (__pyx_v_R[11]) = 0.0;

  /* "/home/jiba/src/soya/ode/body.pyx":147 */
  dBodySetPosition(__pyx_v_self->_bid,(__pyx_v_m[12]),(__pyx_v_m[13]),(__pyx_v_m[14]));

  /* "/home/jiba/src/soya/ode/body.pyx":148 */
  dBodySetRotation(__pyx_v_self->_bid,__pyx_v_R);

  /* "/home/jiba/src/soya/ode/body.pyx":151 */
  __pyx_v_self->_valid = 0;

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode._Body._invalidate");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
}

static PyObject *__pyx_n_advance_time;

static PyObject *__pyx_f_4_ode_5_Body_advance_time(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_advance_time[] = "Interpolate between the last two quaternions";
static PyObject *__pyx_f_4_ode_5_Body_advance_time(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_proportion;
  GLfloat (__pyx_v_q[4]);
  dReal (*__pyx_v_r);
  dReal (*__pyx_v_p);
  float __pyx_v_t;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"proportion",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "f", __pyx_argnames, &__pyx_v_proportion)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/body.pyx":159 */
  ((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_t = (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_t + __pyx_v_proportion);

  /* "/home/jiba/src/soya/ode/body.pyx":161 */
  __pyx_1 = dBodyIsEnabled(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/body.pyx":162 */
    __pyx_v_r = dBodyGetQuaternion(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid);

    /* "/home/jiba/src/soya/ode/body.pyx":163 */
    __pyx_v_p = dBodyGetPosition(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid);

    /* "/home/jiba/src/soya/ode/body.pyx":164 */
    __pyx_1 = ((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_valid;
    if (__pyx_1) {

      /* "/home/jiba/src/soya/ode/body.pyx":165 */
      __pyx_v_t = (1.0 - ((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_t);

      /* "/home/jiba/src/soya/ode/body.pyx":169 */
      (__pyx_v_q[0]) = ((__pyx_v_t * (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_q[0])) + (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_t * (__pyx_v_r[1])));

      /* "/home/jiba/src/soya/ode/body.pyx":170 */
      (__pyx_v_q[1]) = ((__pyx_v_t * (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_q[1])) + (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_t * (__pyx_v_r[2])));

      /* "/home/jiba/src/soya/ode/body.pyx":171 */
      (__pyx_v_q[2]) = ((__pyx_v_t * (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_q[2])) + (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_t * (__pyx_v_r[3])));

      /* "/home/jiba/src/soya/ode/body.pyx":172 */
      (__pyx_v_q[3]) = ((__pyx_v_t * (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_q[3])) + (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_t * (__pyx_v_r[0])));

      /* "/home/jiba/src/soya/ode/body.pyx":175 */
      matrix_from_quaternion(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base._matrix,__pyx_v_q);

      /* "/home/jiba/src/soya/ode/body.pyx":178 */
      (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base._matrix[12]) = ((__pyx_v_t * (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_p[0])) + (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_t * (__pyx_v_p[0])));

      /* "/home/jiba/src/soya/ode/body.pyx":179 */
      (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base._matrix[13]) = ((__pyx_v_t * (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_p[1])) + (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_t * (__pyx_v_p[1])));

      /* "/home/jiba/src/soya/ode/body.pyx":180 */
      (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base._matrix[14]) = ((__pyx_v_t * (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_p[2])) + (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_t * (__pyx_v_p[2])));
      goto __pyx_L3;
    }
    /*else*/ {

      /* "/home/jiba/src/soya/ode/body.pyx":184 */
      (__pyx_v_q[0]) = (__pyx_v_r[1]);

      /* "/home/jiba/src/soya/ode/body.pyx":185 */
      (__pyx_v_q[1]) = (__pyx_v_r[2]);

      /* "/home/jiba/src/soya/ode/body.pyx":186 */
      (__pyx_v_q[2]) = (__pyx_v_r[3]);

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

      /* "/home/jiba/src/soya/ode/body.pyx":188 */
      matrix_from_quaternion(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base._matrix,__pyx_v_q);

      /* "/home/jiba/src/soya/ode/body.pyx":189 */
      (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base._matrix[12]) = (__pyx_v_p[0]);

      /* "/home/jiba/src/soya/ode/body.pyx":190 */
      (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base._matrix[13]) = (__pyx_v_p[1]);

      /* "/home/jiba/src/soya/ode/body.pyx":191 */
      (((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base._matrix[14]) = (__pyx_v_p[2]);
    }
    __pyx_L3:;

    /* "/home/jiba/src/soya/ode/body.pyx":195 */
    __pyx_vtabptr_5_soya__World->__pyx_base.__pyx_base._invalidate(((struct __pyx_obj_5_soya_CoordSyst *)((struct __pyx_obj_4_ode__Body *)__pyx_v_self)));
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/body.pyx":198 */
  __pyx_2 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5_soya__World), __pyx_n_advance_time); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 198; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble(__pyx_v_proportion); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 198; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 198; goto __pyx_L1;}
  Py_INCREF((PyObject *)__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_self);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 198; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __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._Body.advance_time");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5_Body_15linear_velocity___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_vel); /*proto*/
static int __pyx_f_4_ode_5_Body_15linear_velocity___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_vel) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_vel);

  /* "/home/jiba/src/soya/ode/body.pyx":202 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 202; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 202; 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 = 202; 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 = 202; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 202; 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 = 202; 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 = 202; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 202; 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 = 202; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodySetLinearVel(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode._Body.linear_velocity.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_vel);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_15linear_velocity___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_5_Body_15linear_velocity___get__(PyObject *__pyx_v_self) {
  dReal (*__pyx_v_p);
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/body.pyx":207 */
  __pyx_v_p = ((dReal (*))dBodyGetLinearVel(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid));

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

static int __pyx_f_4_ode_5_Body_16angular_velocity___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_vel); /*proto*/
static char __pyx_doc_4_ode_5_Body_16angular_velocity___set__[] = "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 int __pyx_f_4_ode_5_Body_16angular_velocity___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_vel) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_vel);

  /* "/home/jiba/src/soya/ode/body.pyx":219 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; 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 = 219; 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 = 219; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; 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 = 219; 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 = 219; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_vel, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; 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 = 219; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodySetAngularVel(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode._Body.angular_velocity.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_vel);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_16angular_velocity___get__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_4_ode_5_Body_16angular_velocity___get__[] = "getAngularVel() -> 3-tuple\n\n						Get the current angular velocity of the body.\n						";
static PyObject *__pyx_f_4_ode_5_Body_16angular_velocity___get__(PyObject *__pyx_v_self) {
  dReal (*__pyx_v_p);
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/body.pyx":228 */
  __pyx_v_p = ((dReal (*))dBodyGetAngularVel(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid));

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

static int __pyx_f_4_ode_5_Body_4mass___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mass); /*proto*/
static char __pyx_doc_4_ode_5_Body_4mass___set__[] = "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 int __pyx_f_4_ode_5_Body_4mass___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mass) {
  int __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_mass);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mass), __pyx_ptype_4_ode_Mass, 1, "mass")) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 232; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/body.pyx":241 */
  dBodySetMass(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid,(&((struct __pyx_obj_4_ode_Mass *)__pyx_v_mass)->_mass));

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._Body.mass.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_mass);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_4mass___get__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_4_ode_5_Body_4mass___get__[] = "getMass() -> mass\n		\n						Return the mass properties as a Mass object.\n						";
static PyObject *__pyx_f_4_ode_5_Body_4mass___get__(PyObject *__pyx_v_self) {
  struct __pyx_obj_4_ode_Mass *__pyx_v_m;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_m = Py_None; Py_INCREF((PyObject *) __pyx_v_m);

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

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

  /* "/home/jiba/src/soya/ode/body.pyx":251 */
  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.mass.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_m);
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_addForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_f);

  /* "/home/jiba/src/soya/ode/body.pyx":263 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 263; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 263; 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 = 263; 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 = 263; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 263; 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 = 263; 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 = 263; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 263; 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 = 263; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddForce(((struct __pyx_obj_4_ode__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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_f);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_addTorque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_t);

  /* "/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_t, __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_t, __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_t, __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;
  dBodyAddTorque(((struct __pyx_obj_4_ode__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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_t);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_addRelForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_f);

  /* "/home/jiba/src/soya/ode/body.pyx":287 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 287; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 287; 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 = 287; 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 = 287; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 287; 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 = 287; 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 = 287; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 287; 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 = 287; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddRelForce(((struct __pyx_obj_4_ode__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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_f);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_addRelTorque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_t);

  /* "/home/jiba/src/soya/ode/body.pyx":299 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 299; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 299; 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 = 299; 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 = 299; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 299; 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 = 299; 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 = 299; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 299; 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 = 299; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddRelTorque(((struct __pyx_obj_4_ode__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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_t);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_addForceAtPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_f);
  Py_INCREF(__pyx_v_p);

  /* "/home/jiba/src/soya/ode/body.pyx":313 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 313; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 313; 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 = 313; 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 = 313; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 313; 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 = 313; 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 = 313; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 313; 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 = 313; 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 = 313; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 313; 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 = 313; 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 = 313; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 313; 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 = 313; 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 = 313; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 313; 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 = 313; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddForceAtPos(((struct __pyx_obj_4_ode__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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_f);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_addForceAtRelPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_f);
  Py_INCREF(__pyx_v_p);

  /* "/home/jiba/src/soya/ode/body.pyx":327 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 327; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 327; 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 = 327; 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 = 327; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 327; 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 = 327; 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 = 327; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 327; 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 = 327; 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 = 327; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 327; 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 = 327; 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 = 327; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 327; 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 = 327; 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 = 327; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 327; 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 = 327; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddForceAtRelPos(((struct __pyx_obj_4_ode__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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_f);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_addRelForceAtPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_f);
  Py_INCREF(__pyx_v_p);

  /* "/home/jiba/src/soya/ode/body.pyx":341 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 341; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 341; 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 = 341; 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 = 341; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 341; 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 = 341; 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 = 341; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 341; 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 = 341; 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 = 341; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 341; 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 = 341; 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 = 341; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 341; 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 = 341; 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 = 341; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 341; 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 = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddRelForceAtPos(((struct __pyx_obj_4_ode__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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_f);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_addRelForceAtRelPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_f);
  Py_INCREF(__pyx_v_p);

  /* "/home/jiba/src/soya/ode/body.pyx":355 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 355; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 355; 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 = 355; 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 = 355; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 355; 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 = 355; 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 = 355; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 355; 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 = 355; 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 = 355; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 355; 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 = 355; 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 = 355; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 355; 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 = 355; 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 = 355; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 355; 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 = 355; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyAddRelForceAtRelPos(((struct __pyx_obj_4_ode__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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_f);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_getForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_getForce[] = "getForce() -> 3-tuple\n\n				Return the current accumulated force.\n				";
static PyObject *__pyx_f_4_ode_5_Body_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((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/body.pyx":365 */
  __pyx_v_f = ((dReal (*))dBodyGetForce(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid));

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

static PyObject *__pyx_f_4_ode_5_Body_getTorque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_getTorque[] = "getTorque() -> 3-tuple\n\n				Return the current accumulated torque.\n				";
static PyObject *__pyx_f_4_ode_5_Body_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((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/body.pyx":376 */
  __pyx_v_f = ((dReal (*))dBodyGetTorque(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid));

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

static PyObject *__pyx_f_4_ode_5_Body_setForce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_f);

  /* "/home/jiba/src/soya/ode/body.pyx":388 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 388; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 388; 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 = 388; 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 = 388; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 388; 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 = 388; 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 = 388; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_f, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 388; 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 = 388; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodySetForce(((struct __pyx_obj_4_ode__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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_f);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_setTorque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_t);

  /* "/home/jiba/src/soya/ode/body.pyx":399 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 399; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 399; 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 = 399; 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 = 399; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 399; 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 = 399; 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 = 399; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 399; 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 = 399; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodySetTorque(((struct __pyx_obj_4_ode__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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_t);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_getRelPointPos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_p);

  /* "/home/jiba/src/soya/ode/body.pyx":414 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 414; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 414; 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 = 414; 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 = 414; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 414; 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 = 414; 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 = 414; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 414; 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 = 414; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyGetRelPointPos(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid,__pyx_3,__pyx_4,__pyx_5,__pyx_v_res);

  /* "/home/jiba/src/soya/ode/body.pyx":415 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 415; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 415; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 415; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 415; 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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_getRelPointVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_p);

  /* "/home/jiba/src/soya/ode/body.pyx":429 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 429; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 429; 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 = 429; 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 = 429; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 429; 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 = 429; 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 = 429; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 429; 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 = 429; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyGetRelPointVel(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid,__pyx_3,__pyx_4,__pyx_5,__pyx_v_res);

  /* "/home/jiba/src/soya/ode/body.pyx":430 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 430; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 430; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 430; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 430; 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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_getPointVel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_p);

  /* "/home/jiba/src/soya/ode/body.pyx":444 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 444; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 444; 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 = 444; 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 = 444; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 444; 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 = 444; 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 = 444; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 444; 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 = 444; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyGetPointVel(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid,__pyx_3,__pyx_4,__pyx_5,__pyx_v_res);

  /* "/home/jiba/src/soya/ode/body.pyx":445 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 445; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 445; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 445; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 445; 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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_getPosRelPoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_p);

  /* "/home/jiba/src/soya/ode/body.pyx":459 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 459; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 459; 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 = 459; 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 = 459; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 459; 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 = 459; 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 = 459; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 459; 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 = 459; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyGetPosRelPoint(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid,__pyx_3,__pyx_4,__pyx_5,__pyx_v_res);

  /* "/home/jiba/src/soya/ode/body.pyx":460 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 460; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 460; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 460; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 460; 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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_p);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_vectorToWorld(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_v);

  /* "/home/jiba/src/soya/ode/body.pyx":473 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 473; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 473; 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 = 473; 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 = 473; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 473; 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 = 473; 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 = 473; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 473; 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 = 473; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyVectorToWorld(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid,__pyx_3,__pyx_4,__pyx_5,__pyx_v_res);

  /* "/home/jiba/src/soya/ode/body.pyx":474 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 474; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 474; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 474; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 474; 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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_v);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_vectorFromWorld(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_5_Body_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_4_ode_5_Body_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_v);

  /* "/home/jiba/src/soya/ode/body.pyx":487 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 487; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 487; 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 = 487; 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 = 487; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 487; 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 = 487; 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 = 487; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_v, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 487; 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 = 487; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodyVectorFromWorld(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid,__pyx_3,__pyx_4,__pyx_5,__pyx_v_res);

  /* "/home/jiba/src/soya/ode/body.pyx":488 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 488; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 488; goto __pyx_L1;}
  __pyx_6 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 488; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 488; 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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_v);
  return __pyx_r;
}

static int __pyx_f_4_ode_5_Body_7enabled___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_flag); /*proto*/
static char __pyx_doc_4_ode_5_Body_7enabled___set__[] = "enable()\n		\n						Manually enable a body.\n						";
static int __pyx_f_4_ode_5_Body_7enabled___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_flag) {
  int __pyx_r;
  int __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_flag);

  /* "/home/jiba/src/soya/ode/body.pyx":498 */
  __pyx_1 = PyObject_IsTrue(__pyx_v_flag); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 498; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/body.pyx":499 */
    dBodyEnable(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid);
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/body.pyx":501 */
    dBodyDisable(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid);
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._Body.enabled.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_flag);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_7enabled___get__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_4_ode_5_Body_7enabled___get__[] = "isEnabled() -> bool\n		\n						Check if a body is currently enabled.\n						";
static PyObject *__pyx_f_4_ode_5_Body_7enabled___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/body.pyx":508 */
  __pyx_1 = PyInt_FromLong(dBodyIsEnabled(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid)); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 508; 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.enabled.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5_Body_20finite_rotation_mode___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mode); /*proto*/
static char __pyx_doc_4_ode_5_Body_20finite_rotation_mode___set__[] = "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 world, 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 int __pyx_f_4_ode_5_Body_20finite_rotation_mode___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mode) {
  int __pyx_r;
  int __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_mode);

  /* "/home/jiba/src/soya/ode/body.pyx":532 */
  __pyx_1 = PyInt_AsLong(__pyx_v_mode); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 532; goto __pyx_L1;}
  dBodySetFiniteRotationMode(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid,__pyx_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._Body.finite_rotation_mode.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_mode);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_20finite_rotation_mode___get__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_4_ode_5_Body_20finite_rotation_mode___get__[] = "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_4_ode_5_Body_20finite_rotation_mode___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/body.pyx":540 */
  __pyx_1 = PyInt_FromLong(dBodyGetFiniteRotationMode(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid)); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 540; 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.finite_rotation_mode.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5_Body_20finite_rotation_axis___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_a); /*proto*/
static char __pyx_doc_4_ode_5_Body_20finite_rotation_axis___set__[] = "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 int __pyx_f_4_ode_5_Body_20finite_rotation_axis___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_a) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_a);

  /* "/home/jiba/src/soya/ode/body.pyx":553 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 553; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_a, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 553; 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 = 553; 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 = 553; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_a, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 553; 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 = 553; 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 = 553; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_a, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 553; 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 = 553; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dBodySetFiniteRotationAxis(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode._Body.finite_rotation_axis.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_a);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_20finite_rotation_axis___get__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_4_ode_5_Body_20finite_rotation_axis___get__[] = "getFiniteRotationAxis() -> 3-tuple\n		\n						Return the current finite rotation axis of the body.\n						";
static PyObject *__pyx_f_4_ode_5_Body_20finite_rotation_axis___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/body.pyx":562 */
  dBodyGetFiniteRotationAxis(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid,__pyx_v_p);

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

static PyObject *__pyx_f_4_ode_5_Body_10num_joints___get__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_4_ode_5_Body_10num_joints___get__[] = "getNumJoints() -> int\n\n						Return the number of joints that are attached to this body.\n						";
static PyObject *__pyx_f_4_ode_5_Body_10num_joints___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/body.pyx":571 */
  __pyx_1 = PyInt_FromLong(dBodyGetNumJoints(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid)); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 571; 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.num_joints.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5_Body_12gravity_mode___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mode); /*proto*/
static char __pyx_doc_4_ode_5_Body_12gravity_mode___set__[] = "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 int __pyx_f_4_ode_5_Body_12gravity_mode___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mode) {
  int __pyx_r;
  int __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_mode);

  /* "/home/jiba/src/soya/ode/body.pyx":584 */
  __pyx_1 = PyInt_AsLong(__pyx_v_mode); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 584; goto __pyx_L1;}
  dBodySetGravityMode(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid,__pyx_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._Body.gravity_mode.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_mode);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_5_Body_12gravity_mode___get__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_4_ode_5_Body_12gravity_mode___get__[] = "getGravityMode() -> bool\n		\n						Return True if the body is influenced by the world\'s gravity.\n						";
static PyObject *__pyx_f_4_ode_5_Body_12gravity_mode___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/body.pyx":591 */
  __pyx_1 = PyInt_FromLong(dBodyGetGravityMode(((struct __pyx_obj_4_ode__Body *)__pyx_v_self)->_bid)); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 591; 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.gravity_mode.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_10JointGroup___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_10JointGroup___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 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_args, &__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_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":34 */
  ((struct __pyx_obj_4_ode_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_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_self);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static int __pyx_f_4_ode_10JointGroup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_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":37 */
  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 37; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_4_ode_JointGroup *)__pyx_v_self)->jointlist);
  ((struct __pyx_obj_4_ode_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_4_ode_10JointGroup___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_f_4_ode_10JointGroup___dealloc__(PyObject *__pyx_v_self) {
  int __pyx_1;
  Py_INCREF(__pyx_v_self);

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

    /* "/home/jiba/src/soya/ode/joints.pyx":41 */
    dJointGroupDestroy(((struct __pyx_obj_4_ode_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_4_ode_10JointGroup_empty(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_10JointGroup_empty[] = "empty()\n\n				Destroy all joints in the group.\n				";
static PyObject *__pyx_f_4_ode_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":49 */
  dJointGroupEmpty(((struct __pyx_obj_4_ode_JointGroup *)__pyx_v_self)->gid);

  /* "/home/jiba/src/soya/ode/joints.pyx":50 */
  __pyx_1 = PyObject_GetIter(((struct __pyx_obj_4_ode_JointGroup *)__pyx_v_self)->jointlist); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 50; 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 = 50; goto __pyx_L1;}
      break;
    }
    Py_DECREF(__pyx_v_j);
    __pyx_v_j = __pyx_2;
    __pyx_2 = 0;

    /* "/home/jiba/src/soya/ode/joints.pyx":51 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_j, __pyx_n__destroyed); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 51; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 51; goto __pyx_L1;}
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 51; 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":52 */
  __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 52; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_4_ode_JointGroup *)__pyx_v_self)->jointlist);
  ((struct __pyx_obj_4_ode_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_f_4_ode_10JointGroup__addjoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":68 */
  __pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4_ode_JointGroup *)__pyx_v_self)->jointlist, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 68; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 68; 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 = 68; 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_4_ode_5Joint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_5Joint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 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_args, &__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_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":89 */
  ((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->jid = 0;

  /* "/home/jiba/src/soya/ode/joints.pyx":90 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->world);
  ((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->world = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":91 */
  ((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->feedback = 0;

  /* "/home/jiba/src/soya/ode/joints.pyx":92 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->body1);
  ((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->body1 = Py_None;

  /* "/home/jiba/src/soya/ode/joints.pyx":93 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->body2);
  ((struct __pyx_obj_4_ode_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_args);
  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_k95p;

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

static int __pyx_f_4_ode_5Joint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_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":96 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 96; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k95p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[4]; __pyx_lineno = 96; 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_4_ode_5Joint___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_f_4_ode_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":99 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_setFeedback); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 99; goto __pyx_L1;}
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 99; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 99; 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 = 99; 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":100 */
  __pyx_4 = (((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->jid != 0);
  if (__pyx_4) {

    /* "/home/jiba/src/soya/ode/joints.pyx":101 */
    dJointDestroy(((struct __pyx_obj_4_ode_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_4_ode_5Joint__destroyed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":111 */
  ((struct __pyx_obj_4_ode_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_n__remove_joint;

static PyObject *__pyx_f_4_ode_5Joint_attach(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_5Joint_attach(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__Body *__pyx_v_body1 = 0;
  struct __pyx_obj_4_ode__Body *__pyx_v_body2 = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"body1","body2",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_body1, &__pyx_v_body2)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_body1);
  Py_INCREF((PyObject *)__pyx_v_body2);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_body1), __pyx_ptype_4_ode__Body, 1, "body1")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 114; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_body2), __pyx_ptype_4_ode__Body, 1, "body2")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 114; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":127 */
  __pyx_1 = ((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->body1 != Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/joints.pyx":128 */
    __pyx_2 = PyObject_GetAttr(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->body1, __pyx_n__remove_joint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 128; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 128; goto __pyx_L1;}
    Py_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 128; 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:;

  /* "/home/jiba/src/soya/ode/joints.pyx":129 */
  __pyx_1 = ((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->body2 != Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/joints.pyx":130 */
    __pyx_2 = PyObject_GetAttr(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->body2, __pyx_n__remove_joint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 130; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 130; goto __pyx_L1;}
    Py_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 130; 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_L3;
  }
  __pyx_L3:;

  /* "/home/jiba/src/soya/ode/joints.pyx":132 */
  Py_INCREF(((PyObject *)__pyx_v_body1));
  Py_DECREF(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->body1);
  ((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->body1 = ((PyObject *)__pyx_v_body1);

  /* "/home/jiba/src/soya/ode/joints.pyx":133 */
  Py_INCREF(((PyObject *)__pyx_v_body2));
  Py_DECREF(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->body2);
  ((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->body2 = ((PyObject *)__pyx_v_body2);

  /* "/home/jiba/src/soya/ode/joints.pyx":134 */
  dJointAttach(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->jid,__pyx_v_body1->_bid,__pyx_v_body2->_bid);

  /* "/home/jiba/src/soya/ode/joints.pyx":137 */
  ((struct __pyx_vtabstruct_4_ode__Body *)__pyx_v_body1->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_add_joint(__pyx_v_body1,((struct __pyx_obj_4_ode_Joint *)__pyx_v_self));

  /* "/home/jiba/src/soya/ode/joints.pyx":138 */
  ((struct __pyx_vtabstruct_4_ode__Body *)__pyx_v_body2->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_add_joint(__pyx_v_body2,((struct __pyx_obj_4_ode_Joint *)__pyx_v_self));

  __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.attach");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_body1);
  Py_DECREF((PyObject *)__pyx_v_body2);
  return __pyx_r;
}

static PyObject *__pyx_n_MemoryError;

static PyObject *__pyx_k96p;

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

static PyObject *__pyx_f_4_ode_5Joint_setFeedback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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_k36;
  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":174 */
  __pyx_1 = PyObject_IsTrue(__pyx_v_flag); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 174; goto __pyx_L1;}
  if (__pyx_1) {

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

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

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

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

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

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

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

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

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

      /* "/home/jiba/src/soya/ode/joints.pyx":188 */
      ((struct __pyx_obj_4_ode_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_4_ode_5Joint_getFeedback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":204 */
  __pyx_v_fb = dJointGetFeedback(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->jid);

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

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

  /* "/home/jiba/src/soya/ode/joints.pyx":208 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_fb->f1[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 208; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_fb->f1[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 208; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_fb->f1[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 208; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 208; 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":209 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_fb->t1[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 209; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_fb->t1[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 209; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_fb->t1[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 209; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 209; 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":210 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_fb->f2[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 210; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_fb->f2[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 210; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_fb->f2[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 210; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 210; 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":211 */
  __pyx_2 = PyFloat_FromDouble((__pyx_v_fb->t2[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 211; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_fb->t2[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 211; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble((__pyx_v_fb->t2[2])); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 211; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 211; 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":212 */
  __pyx_2 = PyTuple_New(4); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 212; 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 PyObject *__pyx_n_ValueError;

static PyObject *__pyx_k97p;

static char (__pyx_k97[]) = "_setParam not implemented!";

static void __pyx_f_4_ode_5Joint__setParam(struct __pyx_obj_4_ode_Joint *__pyx_v_self,int __pyx_v_param,dReal __pyx_v_value) {
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":215 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 215; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k97p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[4]; __pyx_lineno = 215; goto __pyx_L1;}

  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_WriteUnraisable("_ode.Joint._setParam");
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_k98p;

static char (__pyx_k98[]) = "_getParam not implemented!";

static dReal __pyx_f_4_ode_5Joint__getParam(struct __pyx_obj_4_ode_Joint *__pyx_v_self,int __pyx_v_param) {
  dReal __pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":218 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 218; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k98p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[4]; __pyx_lineno = 218; goto __pyx_L1;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_WriteUnraisable("_ode.Joint._getParam");
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":222 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamLoStop); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 222; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 222; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 222; 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.Joint.lo_stop.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_7lo_stop___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_7lo_stop___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 224; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":225 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamLoStop); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 225; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 225; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.lo_stop.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":229 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamHiStop); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 229; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 229; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 229; 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.Joint.hi_stop.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_7hi_stop___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_7hi_stop___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 231; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":232 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamHiStop); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 232; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 232; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.hi_stop.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":236 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamVel); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 236; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 236; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 236; 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.Joint.velocity.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_8velocity___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_8velocity___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 238; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":239 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamVel); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.velocity.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":243 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamFMax); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 243; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 243; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 243; 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.Joint.fmax.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_4fmax___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_4fmax___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 245; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":246 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamFMax); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 246; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 246; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.fmax.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":250 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamFudgeFactor); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 250; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 250; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 250; 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.Joint.fudge_factor.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_12fudge_factor___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_12fudge_factor___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 252; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":253 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamFudgeFactor); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 253; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 253; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.fudge_factor.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":257 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamBounce); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 257; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 257; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 257; 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.Joint.bounce.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_6bounce___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_6bounce___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 259; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":260 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamBounce); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 260; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 260; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.bounce.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":264 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamCFM); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 264; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 264; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 264; 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.Joint.cfm.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_3cfm___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_3cfm___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 266; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":267 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamCFM); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 267; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 267; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.cfm.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":271 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamStopERP); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 271; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 271; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 271; 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.Joint.stop_erp.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_8stop_erp___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_8stop_erp___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 273; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":274 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamStopERP); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 274; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 274; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.stop_erp.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":278 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamStopCFM); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; 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.Joint.stop_cfm.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_8stop_cfm___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_8stop_cfm___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 280; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":281 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamStopCFM); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.stop_cfm.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":285 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamSuspensionERP); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 285; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 285; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __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.Joint.suspension_erp.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_14suspension_erp___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_14suspension_erp___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 287; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":288 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamSuspensionERP); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 288; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 288; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.suspension_erp.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":292 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamSuspensionCFM); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 292; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 292; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __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.Joint.suspension_cfm.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_14suspension_cfm___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_14suspension_cfm___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 294; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":295 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamSuspensionCFM); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 295; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 295; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.suspension_cfm.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":299 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamLoStop); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 299; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 299; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 299; 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.Joint.lo_stop2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_8lo_stop2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_8lo_stop2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 301; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":302 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamLoStop); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 302; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 302; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.lo_stop2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":306 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamHiStop2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 306; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 306; 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.Joint.hi_stop2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_8hi_stop2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_8hi_stop2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 308; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":309 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamHiStop2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 309; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 309; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.hi_stop2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":313 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamVel2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 313; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 313; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 313; 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.Joint.velocity2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_9velocity2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_9velocity2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 315; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":316 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamVel2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 316; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 316; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.velocity2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":320 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamFMax2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 320; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 320; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 320; 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.Joint.fmax2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_5fmax2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_5fmax2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 322; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":323 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamFMax2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 323; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 323; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.fmax2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":327 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamFudgeFactor2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 327; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 327; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 327; 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.Joint.fudge_factor2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_13fudge_factor2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_13fudge_factor2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 329; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":330 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamFudgeFactor2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 330; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 330; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.fudge_factor2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":334 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamBounce2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 334; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 334; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 334; 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.Joint.bounce2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_7bounce2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_7bounce2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 336; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":337 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamBounce2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 337; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 337; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.bounce2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":341 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamCFM2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 341; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 341; 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.Joint.cfm2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_4cfm2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_4cfm2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 343; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":344 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamCFM2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 344; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 344; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.cfm2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":348 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamStopERP2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 348; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 348; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 348; 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.Joint.stop_erp2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_9stop_erp2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_9stop_erp2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 350; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":351 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamStopERP2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 351; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 351; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.stop_erp2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":355 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamStopCFM2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 355; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 355; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __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.Joint.stop_cfm2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_9stop_cfm2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_9stop_cfm2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 357; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":358 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamStopCFM2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 358; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 358; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.stop_cfm2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":362 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamSuspensionERP2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 362; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 362; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 362; 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.Joint.suspension_erp2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_15suspension_erp2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_15suspension_erp2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 364; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":365 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamSuspensionERP2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.suspension_erp2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/joints.pyx":369 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamSuspensionCFM2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 369; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 369; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_getParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 369; 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.Joint.suspension_cfm2.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_5Joint_15suspension_cfm2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_f_4_ode_5Joint_15suspension_cfm2___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  Py_INCREF(__pyx_v_self);
  __pyx_v_value = PyFloat_AsDouble(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 371; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":372 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParamSuspensionCFM2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 372; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 372; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_vtabstruct_4_ode_Joint *)((struct __pyx_obj_4_ode_Joint *)__pyx_v_self)->__pyx_vtab)->_setParam(((struct __pyx_obj_4_ode_Joint *)__pyx_v_self),__pyx_2,__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.Joint.suspension_cfm2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_9BallJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_9BallJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  struct __pyx_obj_4_ode_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_k37;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = Py_None; Py_INCREF((PyObject *) __pyx_v_jg);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 386; goto __pyx_L1;}

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

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

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

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

  /* "/home/jiba/src/soya/ode/joints.pyx":394 */
  ((struct __pyx_obj_4_ode_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_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static PyObject *__pyx_n__addjoint;

static int __pyx_f_4_ode_9BallJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_9BallJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__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_k38;
  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((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 396; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":397 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_4_ode_BallJoint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_4_ode_BallJoint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

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

    /* "/home/jiba/src/soya/ode/joints.pyx":399 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 399; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 399; 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 = 399; 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((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static int __pyx_f_4_ode_9BallJoint_6anchor___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_pos); /*proto*/
static int __pyx_f_4_ode_9BallJoint_6anchor___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_pos) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_pos);

  /* "/home/jiba/src/soya/ode/joints.pyx":411 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 411; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 411; 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 = 411; 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 = 411; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 411; 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 = 411; 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 = 411; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 411; 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 = 411; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetBallAnchor(((struct __pyx_obj_4_ode_BallJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode.BallJoint.anchor.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_pos);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_9BallJoint_6anchor___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_9BallJoint_6anchor___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":415 */
  dJointGetBallAnchor(((struct __pyx_obj_4_ode_BallJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

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

static PyObject *__pyx_f_4_ode_9BallJoint_7anchor2___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_9BallJoint_7anchor2___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":427 */
  dJointGetBallAnchor2(((struct __pyx_obj_4_ode_BallJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

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

static void __pyx_f_4_ode_9BallJoint__setParam(struct __pyx_obj_4_ode_BallJoint *__pyx_v_self,int __pyx_v_param,dReal __pyx_v_value) {
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":432 */

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.BallJoint._setParam");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
}

static dReal __pyx_f_4_ode_9BallJoint__getParam(struct __pyx_obj_4_ode_BallJoint *__pyx_v_self,int __pyx_v_param) {
  dReal __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":436 */
  __pyx_r = 0.0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.BallJoint._getParam");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_10HingeJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_10HingeJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  struct __pyx_obj_4_ode_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_k39;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = Py_None; Py_INCREF((PyObject *) __pyx_v_jg);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 448; goto __pyx_L1;}

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

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

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

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

  /* "/home/jiba/src/soya/ode/joints.pyx":456 */
  ((struct __pyx_obj_4_ode_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_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static int __pyx_f_4_ode_10HingeJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_10HingeJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__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_k40;
  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((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 458; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":459 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_4_ode_HingeJoint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_4_ode_HingeJoint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

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

    /* "/home/jiba/src/soya/ode/joints.pyx":461 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 461; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 461; 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 = 461; 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((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static int __pyx_f_4_ode_10HingeJoint_6anchor___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_pos); /*proto*/
static int __pyx_f_4_ode_10HingeJoint_6anchor___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_pos) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_pos);

  /* "/home/jiba/src/soya/ode/joints.pyx":472 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 472; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 472; 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 = 472; 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 = 472; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 472; 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 = 472; 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 = 472; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 472; 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 = 472; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetHingeAnchor(((struct __pyx_obj_4_ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode.HingeJoint.anchor.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_pos);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_10HingeJoint_6anchor___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_10HingeJoint_6anchor___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":476 */
  dJointGetHingeAnchor(((struct __pyx_obj_4_ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

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

static PyObject *__pyx_f_4_ode_10HingeJoint_7anchor2___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_10HingeJoint_7anchor2___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":488 */
  dJointGetHingeAnchor2(((struct __pyx_obj_4_ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

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

static int __pyx_f_4_ode_10HingeJoint_4axis___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_axis); /*proto*/
static int __pyx_f_4_ode_10HingeJoint_4axis___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_axis) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_axis);

  /* "/home/jiba/src/soya/ode/joints.pyx":502 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 502; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 502; 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 = 502; 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 = 502; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 502; 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 = 502; 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 = 502; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 502; 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 = 502; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetHingeAxis(((struct __pyx_obj_4_ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode.HingeJoint.axis.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_axis);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_10HingeJoint_4axis___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_10HingeJoint_4axis___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":506 */
  dJointGetHingeAxis(((struct __pyx_obj_4_ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

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

static PyObject *__pyx_f_4_ode_10HingeJoint_5angle___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_10HingeJoint_5angle___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":521 */
  __pyx_1 = PyFloat_FromDouble(dJointGetHingeAngle(((struct __pyx_obj_4_ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 521; 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.angle.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_10HingeJoint_10angle_rate___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_10HingeJoint_10angle_rate___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":529 */
  __pyx_1 = PyFloat_FromDouble(dJointGetHingeAngleRate(((struct __pyx_obj_4_ode_HingeJoint *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 529; 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.angle_rate.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static char (__pyx_k99[]) = "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 void __pyx_f_4_ode_10HingeJoint__setParam(struct __pyx_obj_4_ode_HingeJoint *__pyx_v_self,int __pyx_v_param,dReal __pyx_v_value) {
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":533 */
  __pyx_k99;

  /* "/home/jiba/src/soya/ode/joints.pyx":550 */
  dJointSetHingeParam(__pyx_v_self->__pyx_base.jid,__pyx_v_param,__pyx_v_value);

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.HingeJoint._setParam");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
}

static char (__pyx_k100[]) = "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 dReal __pyx_f_4_ode_10HingeJoint__getParam(struct __pyx_obj_4_ode_HingeJoint *__pyx_v_self,int __pyx_v_param) {
  dReal __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":554 */
  __pyx_k100;

  /* "/home/jiba/src/soya/ode/joints.pyx":568 */
  __pyx_r = dJointGetHingeParam(__pyx_v_self->__pyx_base.jid,__pyx_v_param);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.HingeJoint._getParam");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_11SliderJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_11SliderJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  struct __pyx_obj_4_ode_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_k41;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = Py_None; Py_INCREF((PyObject *) __pyx_v_jg);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 580; goto __pyx_L1;}

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

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

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

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

  /* "/home/jiba/src/soya/ode/joints.pyx":588 */
  ((struct __pyx_obj_4_ode_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_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static int __pyx_f_4_ode_11SliderJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_11SliderJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__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_k42;
  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((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 590; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":591 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_4_ode_SliderJoint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_4_ode_SliderJoint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

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

    /* "/home/jiba/src/soya/ode/joints.pyx":593 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 593; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 593; 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 = 593; 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((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static int __pyx_f_4_ode_11SliderJoint_4axis___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_axis); /*proto*/
static int __pyx_f_4_ode_11SliderJoint_4axis___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_axis) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_axis);

  /* "/home/jiba/src/soya/ode/joints.pyx":604 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 604; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 604; 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 = 604; 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 = 604; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 604; 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 = 604; 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 = 604; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 604; 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 = 604; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetSliderAxis(((struct __pyx_obj_4_ode_SliderJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode.SliderJoint.axis.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_axis);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_11SliderJoint_4axis___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_11SliderJoint_4axis___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":608 */
  dJointGetSliderAxis(((struct __pyx_obj_4_ode_SliderJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

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

static PyObject *__pyx_f_4_ode_11SliderJoint_8position___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_11SliderJoint_8position___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":621 */
  __pyx_1 = PyFloat_FromDouble(dJointGetSliderPosition(((struct __pyx_obj_4_ode_SliderJoint *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 621; 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.position.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_11SliderJoint_13position_rate___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_11SliderJoint_13position_rate___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":629 */
  __pyx_1 = PyFloat_FromDouble(dJointGetSliderPositionRate(((struct __pyx_obj_4_ode_SliderJoint *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 629; 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.position_rate.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static void __pyx_f_4_ode_11SliderJoint__setParam(struct __pyx_obj_4_ode_SliderJoint *__pyx_v_self,int __pyx_v_param,dReal __pyx_v_value) {
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":633 */
  dJointSetSliderParam(__pyx_v_self->__pyx_base.jid,__pyx_v_param,__pyx_v_value);

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.SliderJoint._setParam");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
}

static dReal __pyx_f_4_ode_11SliderJoint__getParam(struct __pyx_obj_4_ode_SliderJoint *__pyx_v_self,int __pyx_v_param) {
  dReal __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":637 */
  __pyx_r = dJointGetSliderParam(__pyx_v_self->__pyx_base.jid,__pyx_v_param);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.SliderJoint._getParam");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_14UniversalJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_14UniversalJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  struct __pyx_obj_4_ode_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_k43;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = Py_None; Py_INCREF((PyObject *) __pyx_v_jg);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 649; goto __pyx_L1;}

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

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

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

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

  /* "/home/jiba/src/soya/ode/joints.pyx":657 */
  ((struct __pyx_obj_4_ode_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_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static int __pyx_f_4_ode_14UniversalJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_14UniversalJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__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_k44;
  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((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 659; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":660 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_4_ode_UniversalJoint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_4_ode_UniversalJoint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

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

    /* "/home/jiba/src/soya/ode/joints.pyx":662 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 662; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 662; 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 = 662; 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((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static int __pyx_f_4_ode_14UniversalJoint_6anchor___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_pos); /*proto*/
static int __pyx_f_4_ode_14UniversalJoint_6anchor___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_pos) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_pos);

  /* "/home/jiba/src/soya/ode/joints.pyx":673 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 673; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 673; 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 = 673; 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 = 673; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 673; 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 = 673; 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 = 673; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 673; 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 = 673; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetUniversalAnchor(((struct __pyx_obj_4_ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode.UniversalJoint.anchor.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_pos);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_14UniversalJoint_6anchor___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_14UniversalJoint_6anchor___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":677 */
  dJointGetUniversalAnchor(((struct __pyx_obj_4_ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

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

static PyObject *__pyx_f_4_ode_14UniversalJoint_7anchor2___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_14UniversalJoint_7anchor2___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":689 */
  dJointGetUniversalAnchor2(((struct __pyx_obj_4_ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

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

static int __pyx_f_4_ode_14UniversalJoint_5axis1___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_axis); /*proto*/
static int __pyx_f_4_ode_14UniversalJoint_5axis1___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_axis) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_axis);

  /* "/home/jiba/src/soya/ode/joints.pyx":702 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 702; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 702; 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 = 702; 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 = 702; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 702; 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 = 702; 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 = 702; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 702; 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 = 702; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetUniversalAxis1(((struct __pyx_obj_4_ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode.UniversalJoint.axis1.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_axis);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_14UniversalJoint_5axis1___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_14UniversalJoint_5axis1___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":706 */
  dJointGetUniversalAxis1(((struct __pyx_obj_4_ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

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

static int __pyx_f_4_ode_14UniversalJoint_5axis2___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_axis); /*proto*/
static int __pyx_f_4_ode_14UniversalJoint_5axis2___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_axis) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_axis);

  /* "/home/jiba/src/soya/ode/joints.pyx":719 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 719; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 719; 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 = 719; 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 = 719; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 719; 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 = 719; 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 = 719; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 719; 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 = 719; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetUniversalAxis2(((struct __pyx_obj_4_ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode.UniversalJoint.axis2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_axis);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_14UniversalJoint_5axis2___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_14UniversalJoint_5axis2___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":723 */
  dJointGetUniversalAxis2(((struct __pyx_obj_4_ode_UniversalJoint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

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

static void __pyx_f_4_ode_14UniversalJoint__setParam(struct __pyx_obj_4_ode_UniversalJoint *__pyx_v_self,int __pyx_v_param,dReal __pyx_v_value) {
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":728 */
  dJointSetUniversalParam(__pyx_v_self->__pyx_base.jid,__pyx_v_param,__pyx_v_value);

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.UniversalJoint._setParam");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
}

static dReal __pyx_f_4_ode_14UniversalJoint__getParam(struct __pyx_obj_4_ode_UniversalJoint *__pyx_v_self,int __pyx_v_param) {
  dReal __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":732 */
  __pyx_r = dJointGetUniversalParam(__pyx_v_self->__pyx_base.jid,__pyx_v_param);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.UniversalJoint._getParam");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_11Hinge2Joint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_11Hinge2Joint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  struct __pyx_obj_4_ode_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_k45;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = Py_None; Py_INCREF((PyObject *) __pyx_v_jg);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 744; goto __pyx_L1;}

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

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

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

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

  /* "/home/jiba/src/soya/ode/joints.pyx":752 */
  ((struct __pyx_obj_4_ode_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_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static int __pyx_f_4_ode_11Hinge2Joint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_11Hinge2Joint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__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_k46;
  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((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 1, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 754; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":755 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_4_ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_4_ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

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

    /* "/home/jiba/src/soya/ode/joints.pyx":757 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 757; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 757; 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 = 757; 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((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static int __pyx_f_4_ode_11Hinge2Joint_6anchor___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_pos); /*proto*/
static int __pyx_f_4_ode_11Hinge2Joint_6anchor___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_pos) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_pos);

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

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode.Hinge2Joint.anchor.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_pos);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_11Hinge2Joint_6anchor___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_11Hinge2Joint_6anchor___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":772 */
  dJointGetHinge2Anchor(((struct __pyx_obj_4_ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

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

static PyObject *__pyx_f_4_ode_11Hinge2Joint_7anchor2___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_11Hinge2Joint_7anchor2___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_p;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":784 */
  dJointGetHinge2Anchor2(((struct __pyx_obj_4_ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_p);

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

static int __pyx_f_4_ode_11Hinge2Joint_5axis1___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_axis); /*proto*/
static int __pyx_f_4_ode_11Hinge2Joint_5axis1___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_axis) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_axis);

  /* "/home/jiba/src/soya/ode/joints.pyx":797 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 797; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 797; 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 = 797; 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 = 797; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 797; 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 = 797; 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 = 797; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 797; 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 = 797; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetHinge2Axis1(((struct __pyx_obj_4_ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode.Hinge2Joint.axis1.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_axis);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_11Hinge2Joint_5axis1___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_11Hinge2Joint_5axis1___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":801 */
  dJointGetHinge2Axis1(((struct __pyx_obj_4_ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

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

static int __pyx_f_4_ode_11Hinge2Joint_5axis2___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_axis); /*proto*/
static int __pyx_f_4_ode_11Hinge2Joint_5axis2___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_axis) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_axis);

  /* "/home/jiba/src/soya/ode/joints.pyx":814 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 814; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 814; 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 = 814; 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 = 814; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 814; 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 = 814; 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 = 814; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 814; 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 = 814; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetHinge2Axis2(((struct __pyx_obj_4_ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode.Hinge2Joint.axis2.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_axis);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_11Hinge2Joint_5axis2___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_11Hinge2Joint_5axis2___get__(PyObject *__pyx_v_self) {
  dVector3 __pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":818 */
  dJointGetHinge2Axis2(((struct __pyx_obj_4_ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_v_a);

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

static PyObject *__pyx_f_4_ode_11Hinge2Joint_6angle1___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_11Hinge2Joint_6angle1___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":831 */
  __pyx_1 = PyFloat_FromDouble(dJointGetHinge2Angle1(((struct __pyx_obj_4_ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 831; 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.angle1.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_11Hinge2Joint_11angle1_rate___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_11Hinge2Joint_11angle1_rate___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":839 */
  __pyx_1 = PyFloat_FromDouble(dJointGetHinge2Angle1Rate(((struct __pyx_obj_4_ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 839; 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.angle1_rate.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_11Hinge2Joint_11angle2_rate___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_11Hinge2Joint_11angle2_rate___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":847 */
  __pyx_1 = PyFloat_FromDouble(dJointGetHinge2Angle2Rate(((struct __pyx_obj_4_ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 847; 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.angle2_rate.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static void __pyx_f_4_ode_11Hinge2Joint__setParam(struct __pyx_obj_4_ode_Hinge2Joint *__pyx_v_self,int __pyx_v_param,dReal __pyx_v_value) {
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":851 */
  dJointSetHinge2Param(__pyx_v_self->__pyx_base.jid,__pyx_v_param,__pyx_v_value);

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.Hinge2Joint._setParam");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
}

static dReal __pyx_f_4_ode_11Hinge2Joint__getParam(struct __pyx_obj_4_ode_Hinge2Joint *__pyx_v_self,int __pyx_v_param) {
  dReal __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":855 */
  __pyx_r = dJointGetHinge2Param(__pyx_v_self->__pyx_base.jid,__pyx_v_param);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.Hinge2Joint._getParam");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_10FixedJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_10FixedJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  struct __pyx_obj_4_ode_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_k47;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = Py_None; Py_INCREF((PyObject *) __pyx_v_jg);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 867; goto __pyx_L1;}

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

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

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

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

  /* "/home/jiba/src/soya/ode/joints.pyx":875 */
  ((struct __pyx_obj_4_ode_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_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static int __pyx_f_4_ode_10FixedJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_10FixedJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__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_k48;
  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((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 877; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":878 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_4_ode_FixedJoint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_4_ode_FixedJoint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

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

    /* "/home/jiba/src/soya/ode/joints.pyx":880 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 880; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 880; 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 = 880; 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((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_10FixedJoint_setFixed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":890 */
  dJointSetFixed(((struct __pyx_obj_4_ode_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_4_ode_12ContactJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_12ContactJoint___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  struct __pyx_obj_4_ode_Contact *__pyx_v_contact = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  struct __pyx_obj_4_ode_JointGroup *__pyx_v_jg;
  dJointGroupID __pyx_v_jgid;
  int __pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"world","jointgroup","contact",0};
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup, &__pyx_v_contact)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  Py_INCREF(__pyx_v_contact);
  __pyx_v_jg = Py_None; Py_INCREF((PyObject *) __pyx_v_jg);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 902; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_contact), __pyx_ptype_4_ode_Contact, 1, "contact")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 902; goto __pyx_L1;}

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

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

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

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

  /* "/home/jiba/src/soya/ode/joints.pyx":909 */
  ((struct __pyx_obj_4_ode_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_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  Py_DECREF(__pyx_v_contact);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static int __pyx_f_4_ode_12ContactJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_12ContactJoint___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  struct __pyx_obj_4_ode_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((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  Py_INCREF(__pyx_v_contact);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 911; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_contact), __pyx_ptype_4_ode_Contact, 1, "contact")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 911; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":912 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_4_ode_ContactJoint *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_4_ode_ContactJoint *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

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

    /* "/home/jiba/src/soya/ode/joints.pyx":914 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 914; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 914; 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 = 914; 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((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  Py_DECREF(__pyx_v_contact);
  return __pyx_r;
}

static int __pyx_f_4_ode_6AMotor___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_6AMotor___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__World *__pyx_v_world = 0;
  PyObject *__pyx_v_jointgroup = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  struct __pyx_obj_4_ode_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_k49;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_world, &__pyx_v_jointgroup)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  __pyx_v_jg = Py_None; Py_INCREF((PyObject *) __pyx_v_jg);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 925; goto __pyx_L1;}

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

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

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

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

  /* "/home/jiba/src/soya/ode/joints.pyx":933 */
  ((struct __pyx_obj_4_ode_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_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_jg);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static int __pyx_f_4_ode_6AMotor___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_6AMotor___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode__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_k50;
  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((PyObject *)__pyx_v_world);
  Py_INCREF(__pyx_v_jointgroup);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_world), __pyx_ptype_4_ode__World, 0, "world")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 935; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/joints.pyx":936 */
  Py_INCREF(((PyObject *)__pyx_v_world));
  Py_DECREF(((struct __pyx_obj_4_ode_AMotor *)__pyx_v_self)->__pyx_base.world);
  ((struct __pyx_obj_4_ode_AMotor *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_world);

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

    /* "/home/jiba/src/soya/ode/joints.pyx":938 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_jointgroup, __pyx_n__addjoint); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 938; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 938; 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 = 938; 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((PyObject *)__pyx_v_world);
  Py_DECREF(__pyx_v_jointgroup);
  return __pyx_r;
}

static int __pyx_f_4_ode_6AMotor_4mode___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mode); /*proto*/
static int __pyx_f_4_ode_6AMotor_4mode___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mode) {
  int __pyx_r;
  int __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_mode);

  /* "/home/jiba/src/soya/ode/joints.pyx":950 */
  __pyx_1 = PyInt_AsLong(__pyx_v_mode); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 950; goto __pyx_L1;}
  dJointSetAMotorMode(((struct __pyx_obj_4_ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.AMotor.mode.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_mode);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_6AMotor_4mode___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_6AMotor_4mode___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":953 */
  __pyx_1 = PyInt_FromLong(dJointGetAMotorMode(((struct __pyx_obj_4_ode_AMotor *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 953; 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.mode.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_6AMotor_setNumAxes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":965 */
  dJointSetAMotorNumAxes(((struct __pyx_obj_4_ode_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_4_ode_6AMotor_getNumAxes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_6AMotor_getNumAxes[] = "getNumAxes() -> int\n\n				Get the number of angular axes that are controlled by the AMotor.\n				";
static PyObject *__pyx_f_4_ode_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":973 */
  __pyx_1 = PyInt_FromLong(dJointGetAMotorNumAxes(((struct __pyx_obj_4_ode_AMotor *)__pyx_v_self)->__pyx_base.jid)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 973; 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_4_ode_6AMotor_setAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":1002 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1002; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1002; 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 = 1002; 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 = 1002; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1002; 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 = 1002; 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 = 1002; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_axis, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1002; 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 = 1002; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dJointSetAMotorAxis(((struct __pyx_obj_4_ode_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_4_ode_6AMotor_getAxis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":1014 */
  dJointGetAMotorAxis(((struct __pyx_obj_4_ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_anum,__pyx_v_a);

  /* "/home/jiba/src/soya/ode/joints.pyx":1015 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_a[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1015; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_a[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1015; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_a[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1015; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1015; 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_4_ode_6AMotor_getAxisRel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":1026 */
  __pyx_1 = PyInt_FromLong(dJointGetAMotorAxisRel(((struct __pyx_obj_4_ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_anum)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1026; 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_4_ode_6AMotor_setAngle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":1041 */
  __pyx_1 = PyFloat_AsDouble(__pyx_v_angle); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1041; goto __pyx_L1;}
  dJointSetAMotorAngle(((struct __pyx_obj_4_ode_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_4_ode_6AMotor_getAngle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":1052 */
  __pyx_1 = PyFloat_FromDouble(dJointGetAMotorAngle(((struct __pyx_obj_4_ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_anum)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1052; 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_4_ode_6AMotor_getAngleRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":1063 */
  __pyx_1 = PyFloat_FromDouble(dJointGetAMotorAngleRate(((struct __pyx_obj_4_ode_AMotor *)__pyx_v_self)->__pyx_base.jid,__pyx_v_anum)); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1063; 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 void __pyx_f_4_ode_6AMotor__setParam(struct __pyx_obj_4_ode_AMotor *__pyx_v_self,int __pyx_v_param,dReal __pyx_v_value) {
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":1067 */
  dJointSetAMotorParam(__pyx_v_self->__pyx_base.jid,__pyx_v_param,__pyx_v_value);

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.AMotor._setParam");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
}

static dReal __pyx_f_4_ode_6AMotor__getParam(struct __pyx_obj_4_ode_AMotor *__pyx_v_self,int __pyx_v_param) {
  dReal __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/joints.pyx":1071 */
  __pyx_r = dJointGetAMotorParam(__pyx_v_self->__pyx_base.jid,__pyx_v_param);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.AMotor._getParam");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_isinstance;

static int __pyx_f_4_ode_10GeomObject___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_10GeomObject___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5_soya_CoordSyst *__pyx_v_parent = 0;
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  dSpaceID __pyx_v_sid;
  struct __pyx_obj_5_soya_CoordSyst *__pyx_v_p;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"parent","space",0};
  __pyx_v_parent = __pyx_k51;
  __pyx_v_space = __pyx_k52;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_parent, &__pyx_v_space)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_parent);
  Py_INCREF((PyObject *)__pyx_v_space);
  __pyx_v_p = Py_None; Py_INCREF((PyObject *) __pyx_v_p);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_5_soya_CoordSyst, 1, "parent")) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/geomobject.pyx":42 */
  __pyx_1 = ((PyObject *)__pyx_v_space) == Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":43 */
    __pyx_v_sid = 0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":45 */
    __pyx_v_sid = __pyx_v_space->sid;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":47 */
  ((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->gid = 0;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":49 */
  Py_INCREF(((PyObject *)__pyx_v_space));
  Py_DECREF((PyObject *)((PyObject *)((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->space));
  ((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->space = ((PyObject *)__pyx_v_space);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":50 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_4_ode__Body)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 50; goto __pyx_L1;}
  Py_INCREF(Py_None);
  Py_DECREF((PyObject *)((PyObject *)((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->_body));
  ((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->_body = Py_None;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":53 */
  Py_INCREF(((PyObject *)__pyx_v_parent));
  Py_DECREF((PyObject *)((PyObject *)__pyx_v_p));
  __pyx_v_p = ((PyObject *)__pyx_v_parent);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":54 */
  while (1) {
    __pyx_L3:;
    __pyx_1 = ((PyObject *)__pyx_v_p) != Py_None;
    if (!__pyx_1) break;

    /* "/home/jiba/src/soya/ode/geomobject.pyx":55 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 55; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 55; goto __pyx_L1;}
    Py_INCREF((PyObject *)((PyObject *)__pyx_v_p));
    PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_p));
    Py_INCREF(((PyObject*)__pyx_ptype_4_ode__Body));
    PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject*)__pyx_ptype_4_ode__Body));
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 55; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 55; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    if (__pyx_1) {

      /* "/home/jiba/src/soya/ode/geomobject.pyx":56 */
      if (!__Pyx_TypeTest(((PyObject *)__pyx_v_p), __pyx_ptype_4_ode__Body)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 56; goto __pyx_L1;}
      Py_INCREF(((PyObject *)__pyx_v_p));
      Py_DECREF((PyObject *)((PyObject *)((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->_body));
      ((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->_body = ((PyObject *)__pyx_v_p);

      /* "/home/jiba/src/soya/ode/geomobject.pyx":57 */
      goto __pyx_L4;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/jiba/src/soya/ode/geomobject.pyx":58 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 58; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 58; goto __pyx_L1;}
    Py_INCREF((PyObject *)((PyObject *)__pyx_v_p));
    PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_p));
    Py_INCREF(((PyObject*)__pyx_ptype_4_ode__World));
    PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject*)__pyx_ptype_4_ode__World));
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 58; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 58; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    if (__pyx_1) {

      /* "/home/jiba/src/soya/ode/geomobject.pyx":59 */
      if (!__Pyx_TypeTest(((PyObject *)__pyx_v_p), __pyx_ptype_4_ode__World)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 59; goto __pyx_L1;}
      Py_INCREF(((PyObject *)__pyx_v_p));
      Py_DECREF((PyObject *)((PyObject *)((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->world));
      ((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->world = ((PyObject *)__pyx_v_p);

      /* "/home/jiba/src/soya/ode/geomobject.pyx":60 */
      goto __pyx_L4;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/jiba/src/soya/ode/geomobject.pyx":61 */
    Py_INCREF(((PyObject *)__pyx_v_p->__pyx_base._parent));
    Py_DECREF((PyObject *)((PyObject *)__pyx_v_p));
    __pyx_v_p = ((PyObject *)__pyx_v_p->__pyx_base._parent);
  }
  __pyx_L4:;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":63 */
  __pyx_1 = ((PyObject *)((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->world) == Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":64 */
    while (1) {
      __pyx_L8:;
      __pyx_1 = ((PyObject *)__pyx_v_p) != Py_None;
      if (!__pyx_1) break;

      /* "/home/jiba/src/soya/ode/geomobject.pyx":65 */
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; goto __pyx_L1;}
      Py_INCREF((PyObject *)((PyObject *)__pyx_v_p));
      PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_p));
      Py_INCREF(((PyObject*)__pyx_ptype_4_ode__World));
      PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject*)__pyx_ptype_4_ode__World));
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      if (__pyx_1) {

        /* "/home/jiba/src/soya/ode/geomobject.pyx":66 */
        if (!__Pyx_TypeTest(((PyObject *)__pyx_v_p), __pyx_ptype_4_ode__World)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 66; goto __pyx_L1;}
        Py_INCREF(((PyObject *)__pyx_v_p));
        Py_DECREF((PyObject *)((PyObject *)((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->world));
        ((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->world = ((PyObject *)__pyx_v_p);

        /* "/home/jiba/src/soya/ode/geomobject.pyx":67 */
        goto __pyx_L9;
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "/home/jiba/src/soya/ode/geomobject.pyx":68 */
      Py_INCREF(((PyObject *)__pyx_v_p->__pyx_base._parent));
      Py_DECREF((PyObject *)((PyObject *)__pyx_v_p));
      __pyx_v_p = ((PyObject *)__pyx_v_p->__pyx_base._parent);
    }
    __pyx_L9:;
    goto __pyx_L7;
  }
  __pyx_L7:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("_ode.GeomObject.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF((PyObject *)__pyx_v_p);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_parent);
  Py_DECREF((PyObject *)__pyx_v_space);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static int __pyx_f_4_ode_10GeomObject___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_10GeomObject___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5_soya_CoordSyst *__pyx_v_parent = 0;
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  static char *__pyx_argnames[] = {"parent","space",0};
  __pyx_v_parent = __pyx_k53;
  __pyx_v_space = __pyx_k54;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_parent, &__pyx_v_space)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_parent);
  Py_INCREF((PyObject *)__pyx_v_space);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_5_soya_CoordSyst, 1, "parent")) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/geomobject.pyx":71 */
  dGeomSetData(((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->gid,((void (*))__pyx_v_self));

  /* "/home/jiba/src/soya/ode/geomobject.pyx":72 */
  __pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5_soya_CoordSyst), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 72; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 72; goto __pyx_L1;}
  Py_INCREF((PyObject *)__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
  Py_INCREF((PyObject *)((PyObject *)__pyx_v_parent));
  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_parent));
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 72; 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/geomobject.pyx":73 */
  __pyx_4 = ((PyObject *)__pyx_v_space) != Py_None;
  if (__pyx_4) {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":75 */
    __pyx_1 = PyObject_GetAttr(__pyx_v_space->geoms, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 75; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 75; goto __pyx_L1;}
    Py_INCREF((PyObject *)__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
    __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 75; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("_ode.GeomObject.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_parent);
  Py_DECREF((PyObject *)__pyx_v_space);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static PyObject *__pyx_k101p;

static char (__pyx_k101[]) = "Cannot use GeomObject directly";

static float __pyx_f_4_ode_10GeomObject__point_depth(struct __pyx_obj_4_ode_GeomObject *__pyx_v_self,float __pyx_v_x,float __pyx_v_y,float __pyx_v_z) {
  float __pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

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

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_WriteUnraisable("_ode.GeomObject._point_depth");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_10GeomObject_point_depth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4_ode_10GeomObject_point_depth(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;
  float __pyx_3;
  float __pyx_4;
  float __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/geomobject.pyx":84 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_pos, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4_ode_GeomObject *)((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_point_depth(((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self),__pyx_3,__pyx_4,__pyx_5)); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; 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.GeomObject.point_depth");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_pos);
  return __pyx_r;
}

static PyObject *__pyx_n_dealloc;


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

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

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

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

    /* "/home/jiba/src/soya/ode/geomobject.pyx":90 */
    ((struct __pyx_obj_4_ode_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((PyObject *)__pyx_v_self);
}

static PyObject *__pyx_f_4_ode_10GeomObject_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":99 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 99; 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((PyObject *)__pyx_v_self);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/geomobject.pyx":103 */
  __pyx_1 = ((PyObject *)((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->_body);
  Py_INCREF((PyObject *)__pyx_1);
  __pyx_2 = PyObject_IsTrue(__pyx_1); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 103; goto __pyx_L1;}
  if (!__pyx_2) {
    Py_DECREF((PyObject *)__pyx_1); __pyx_1 = 0;
    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_environment); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 103; 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.body.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_10GeomObject_begin_round(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_10GeomObject_begin_round[] = "Need to update the ODE state every round";
static PyObject *__pyx_f_4_ode_10GeomObject_begin_round(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/geomobject.pyx":107 */
  ((struct __pyx_vtabstruct_4_ode_GeomObject *)((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base._invalidate(((struct __pyx_obj_5_soya_CoordSyst *)((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)));

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.GeomObject.begin_round");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_placeable;

static char (__pyx_k103[]) = "Update the geom\'s matrix after invalidating the root and inverted\n				root matrices. We do this here because all movement methods must\n				call this.";

static void __pyx_f_4_ode_10GeomObject__invalidate(struct __pyx_obj_4_ode_GeomObject *__pyx_v_self) {
  dMatrix3 __pyx_v_R;
  GLfloat (__pyx_v_m[19]);
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":110 */
  __pyx_k103;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":117 */
  __pyx_vtabptr_5_soya_CoordSyst->_invalidate(((struct __pyx_obj_5_soya_CoordSyst *)__pyx_v_self));

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

    /* "/home/jiba/src/soya/ode/geomobject.pyx":124 */
    multiply_matrix(__pyx_v_m,((struct __pyx_vtabstruct_4_ode_GeomObject *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base._root_matrix(((struct __pyx_obj_5_soya_CoordSyst *)__pyx_v_self)),((struct __pyx_vtabstruct_4_ode__World *)__pyx_v_self->world->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base._inverted_root_matrix(((struct __pyx_obj_5_soya_CoordSyst *)__pyx_v_self->world)));

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

    /* "/home/jiba/src/soya/ode/geomobject.pyx":127 */
    (__pyx_v_R[1]) = (__pyx_v_m[4]);

    /* "/home/jiba/src/soya/ode/geomobject.pyx":128 */
    (__pyx_v_R[2]) = (__pyx_v_m[8]);

    /* "/home/jiba/src/soya/ode/geomobject.pyx":129 */
    (__pyx_v_R[3]) = 0.0;

    /* "/home/jiba/src/soya/ode/geomobject.pyx":130 */
    (__pyx_v_R[4]) = (__pyx_v_m[1]);

    /* "/home/jiba/src/soya/ode/geomobject.pyx":131 */
    (__pyx_v_R[5]) = (__pyx_v_m[5]);

    /* "/home/jiba/src/soya/ode/geomobject.pyx":132 */
    (__pyx_v_R[6]) = (__pyx_v_m[9]);

    /* "/home/jiba/src/soya/ode/geomobject.pyx":133 */
    (__pyx_v_R[7]) = 0.0;

    /* "/home/jiba/src/soya/ode/geomobject.pyx":134 */
    (__pyx_v_R[8]) = (__pyx_v_m[2]);

    /* "/home/jiba/src/soya/ode/geomobject.pyx":135 */
    (__pyx_v_R[9]) = (__pyx_v_m[6]);

    /* "/home/jiba/src/soya/ode/geomobject.pyx":136 */
    (__pyx_v_R[10]) = (__pyx_v_m[10]);

    /* "/home/jiba/src/soya/ode/geomobject.pyx":137 */
    (__pyx_v_R[11]) = 0.0;

    /* "/home/jiba/src/soya/ode/geomobject.pyx":141 */
    dGeomSetPosition(__pyx_v_self->gid,(__pyx_v_m[12]),(__pyx_v_m[13]),(__pyx_v_m[14]));

    /* "/home/jiba/src/soya/ode/geomobject.pyx":142 */
    dGeomSetRotation(__pyx_v_self->gid,__pyx_v_R);
    goto __pyx_L2;
  }
  __pyx_L2:;

  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_WriteUnraisable("_ode.GeomObject._invalidate");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
}

static PyObject *__pyx_f_4_ode_10GeomObject_getAABB(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":152 */
  dGeomGetAABB(((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->gid,__pyx_v_aabb);

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

static PyObject *__pyx_f_4_ode_10GeomObject_isSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_10GeomObject_isSpace[] = "isSpace() -> bool\n\n				Return 1 if the given geom is a space, or 0 if not.";
static PyObject *__pyx_f_4_ode_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((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":159 */
  __pyx_1 = PyInt_FromLong(dGeomIsSpace(((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 159; 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((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_10GeomObject_getSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":166 */
  Py_INCREF((PyObject *)((PyObject *)((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->space));
  __pyx_r = ((PyObject *)((struct __pyx_obj_4_ode_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((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_10GeomObject_setCollideBits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_bits);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":176 */
  __pyx_1 = PyLong_AsUnsignedLong(__pyx_v_bits); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 176; goto __pyx_L1;}
  dGeomSetCollideBits(((struct __pyx_obj_4_ode_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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_bits);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_10GeomObject_setCategoryBits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_bits);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":186 */
  __pyx_1 = PyLong_AsUnsignedLong(__pyx_v_bits); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 186; goto __pyx_L1;}
  dGeomSetCategoryBits(((struct __pyx_obj_4_ode_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((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_bits);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_10GeomObject_getCollideBits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_10GeomObject_getCollideBits[] = "getCollideBits() -> int\n\n				Return the \"collide\" bitfields for this geom.\n				";
static PyObject *__pyx_f_4_ode_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((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":193 */
  __pyx_1 = PyLong_FromUnsignedLong(dGeomGetCollideBits(((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 193; 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((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_10GeomObject_getCategoryBits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_10GeomObject_getCategoryBits[] = "getCategoryBits() -> int\n\n				Return the \"category\" bitfields for this geom.\n				";
static PyObject *__pyx_f_4_ode_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((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":200 */
  __pyx_1 = PyLong_FromUnsignedLong(dGeomGetCategoryBits(((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 200; 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((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_10GeomObject_7enabled___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_flag); /*proto*/
static int __pyx_f_4_ode_10GeomObject_7enabled___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_flag) {
  int __pyx_r;
  int __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_flag);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":204 */
  __pyx_1 = PyObject_IsTrue(__pyx_v_flag); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 204; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":205 */
    dGeomEnable(((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->gid);
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/geomobject.pyx":207 */
    dGeomDisable(((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->gid);
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.GeomObject.enabled.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_flag);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_10GeomObject_7enabled___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_10GeomObject_7enabled___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geomobject.pyx":210 */
  __pyx_1 = PyInt_FromLong(dGeomIsEnabled(((struct __pyx_obj_4_ode_GeomObject *)__pyx_v_self)->gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 210; 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.enabled.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_9SpaceBase___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_9SpaceBase___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 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_args, &__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_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/space.pyx":36 */
  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 36; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->geoms);
  ((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->geoms = __pyx_1;
  __pyx_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_ode.SpaceBase.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  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_n__create;

static int __pyx_f_4_ode_9SpaceBase___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_9SpaceBase___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5_soya__World *__pyx_v_parent = 0;
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"parent","space",0};
  __pyx_v_parent = __pyx_k55;
  __pyx_v_space = __pyx_k56;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_parent, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_parent);
  Py_INCREF((PyObject *)__pyx_v_space);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_5_soya__World, 1, "parent")) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/space.pyx":40 */
  if (!__Pyx_TypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_4_ode__World)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 40; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_parent));
  Py_DECREF((PyObject *)((PyObject *)((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->__pyx_base.world));
  ((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->__pyx_base.world = ((PyObject *)__pyx_v_parent);

  /* "/home/jiba/src/soya/ode/space.pyx":42 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n__create); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 42; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 42; goto __pyx_L1;}
  Py_INCREF((PyObject *)((PyObject *)__pyx_v_space));
  PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_space));
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 42; 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/space.pyx":44 */
  dGeomSetData(((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->__pyx_base.gid,((void (*))__pyx_v_self));

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("_ode.SpaceBase.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_parent);
  Py_DECREF((PyObject *)__pyx_v_space);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/space.pyx":50 */
  __pyx_1 = (((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->__pyx_base.gid != 0);
  if (__pyx_1) {

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

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

    /* "/home/jiba/src/soya/ode/space.pyx":53 */
    ((struct __pyx_obj_4_ode_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_4_ode_9SpaceBase_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_9SpaceBase_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode_GeomObject *__pyx_v_geom = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 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((PyObject *)__pyx_v_geom);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_4_ode_GeomObject, 1, "geom")) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 60; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/space.pyx":70 */
  __pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->geoms, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; goto __pyx_L1;}
  Py_INCREF((PyObject *)((PyObject *)__pyx_v_geom));
  PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_geom));
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; 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/space.pyx":71 */
  dSpaceAdd(((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->sid,__pyx_v_geom->gid);

  __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.SpaceBase.add");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_geom);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_9SpaceBase_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_9SpaceBase_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode_GeomObject *__pyx_v_geom = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 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((PyObject *)__pyx_v_geom);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_4_ode_GeomObject, 1, "geom")) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 73; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/space.pyx":82 */
  __pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->geoms, __pyx_n_remove); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 82; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 82; goto __pyx_L1;}
  Py_INCREF((PyObject *)((PyObject *)__pyx_v_geom));
  PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_geom));
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 82; 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/space.pyx":83 */
  dSpaceRemove(((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->sid,__pyx_v_geom->gid);

  __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.SpaceBase.remove");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_geom);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_9SpaceBase_set_last_transformations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_9SpaceBase_set_last_transformations[] = "Set the last transformation for each TriMesh geom in the space.\n				This must be called before the geoms are moved but after the \n				previous collisions.";
static PyObject *__pyx_f_4_ode_9SpaceBase_set_last_transformations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode_GeomObject *__pyx_v_geom;
  struct __pyx_obj_4_ode__TriMesh *__pyx_v_trimesh;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  int __pyx_5;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_geom = Py_None; Py_INCREF((PyObject *) __pyx_v_geom);
  __pyx_v_trimesh = Py_None; Py_INCREF((PyObject *) __pyx_v_trimesh);

  /* "/home/jiba/src/soya/ode/space.pyx":93 */
  __pyx_1 = PyObject_GetIter(((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->geoms); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 93; goto __pyx_L1;}
  for (;;) {
    __pyx_L2:;
    __pyx_2 = PyIter_Next(__pyx_1);
    if (!__pyx_2) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 93; goto __pyx_L1;}
      break;
    }
    if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4_ode_GeomObject)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 93; goto __pyx_L1;}
    Py_DECREF((PyObject *)((PyObject *)__pyx_v_geom));
    __pyx_v_geom = __pyx_2;
    __pyx_2 = 0;

    /* "/home/jiba/src/soya/ode/space.pyx":94 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 94; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 94; goto __pyx_L1;}
    Py_INCREF((PyObject *)((PyObject *)__pyx_v_geom));
    PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_geom));
    Py_INCREF(((PyObject*)__pyx_ptype_4_ode__TriMesh));
    PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject*)__pyx_ptype_4_ode__TriMesh));
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 94; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_5 = PyObject_IsTrue(__pyx_4); if (__pyx_5 < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 94; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    if (__pyx_5) {

      /* "/home/jiba/src/soya/ode/space.pyx":95 */
      Py_INCREF(((PyObject *)((PyObject *)__pyx_v_geom)));
      Py_DECREF((PyObject *)((PyObject *)__pyx_v_trimesh));
      __pyx_v_trimesh = ((PyObject *)((PyObject *)__pyx_v_geom));

      /* "/home/jiba/src/soya/ode/space.pyx":96 */
      ((struct __pyx_vtabstruct_4_ode__TriMesh *)__pyx_v_trimesh->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_set_last_transformation(__pyx_v_trimesh);
      goto __pyx_L4;
    }
    __pyx_L4:;
  }
  __pyx_L3:;
  Py_DECREF(__pyx_1); __pyx_1 = 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.SpaceBase.set_last_transformations");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_geom);
  Py_DECREF((PyObject *)__pyx_v_trimesh);
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_9SpaceBase_query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_9SpaceBase_query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode_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((PyObject *)__pyx_v_geom);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_4_ode_GeomObject, 1, "geom")) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 98; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/space.pyx":106 */
  __pyx_1 = PyInt_FromLong(dSpaceQuery(((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->sid,__pyx_v_geom->gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 106; 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((PyObject *)__pyx_v_geom);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_9SpaceBase_getNumGeoms(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_9SpaceBase_getNumGeoms[] = "getNumGeoms() -> int\n\n				Return the number of geoms contained within the space.\n				";
static PyObject *__pyx_f_4_ode_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":113 */
  __pyx_1 = PyInt_FromLong(dSpaceGetNumGeoms(((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->sid)); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 113; 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_IndexError;

static PyObject *__pyx_k104p;

static char (__pyx_k104[]) = "geom index out of range";

static PyObject *__pyx_f_4_ode_9SpaceBase_getGeom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_9SpaceBase_getGeom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_idx;
  dGeomID __pyx_v_gid;
  void (*__pyx_v_data);
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 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":127 */
  __pyx_1 = (__pyx_v_idx < 0);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_idx >= dSpaceGetNumGeoms(((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->sid));
  }
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/space.pyx":128 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_IndexError); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 128; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k104p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[6]; __pyx_lineno = 128; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

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

  /* "/home/jiba/src/soya/ode/space.pyx":135 */
  __pyx_v_data = dGeomGetData(__pyx_v_gid);

  /* "/home/jiba/src/soya/ode/space.pyx":136 */
  __pyx_2 = (PyObject *)__pyx_v_data;
  Py_INCREF(__pyx_2);
  __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.SpaceBase.getGeom");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_9SpaceBase_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4_ode_9SpaceBase_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/space.pyx":150 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __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.SpaceBase.placeable");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_9SpaceBase_collide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_9SpaceBase_collide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {"callback",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_callback)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_callback);

  /* "/home/jiba/src/soya/ode/space.pyx":172 */
  dSpaceCollide(((struct __pyx_obj_4_ode_SpaceBase *)__pyx_v_self)->sid,((void (*))__pyx_v_callback),__pyx_f_4_ode_collide_callback);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.SpaceBase.collide");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_callback);
  return __pyx_r;
}

static void __pyx_f_4_ode_collide_callback(void (*__pyx_v_data),dGeomID __pyx_v_o1,dGeomID __pyx_v_o2) {
  void (*__pyx_v_g1);
  void (*__pyx_v_g2);
  PyObject *__pyx_v_callback;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  __pyx_v_callback = Py_None; Py_INCREF(__pyx_v_callback);

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

  /* "/home/jiba/src/soya/ode/space.pyx":190 */
  __pyx_2 = dGeomIsSpace(__pyx_v_o1);
  if (!__pyx_2) {
    __pyx_2 = dGeomIsSpace(__pyx_v_o2);
  }
  if (__pyx_2) {

    /* "/home/jiba/src/soya/ode/space.pyx":191 */
    dSpaceCollide2(__pyx_v_o1,__pyx_v_o2,__pyx_v_data,__pyx_f_4_ode_collide_callback);
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/space.pyx":193 */
    __pyx_v_g1 = dGeomGetData(__pyx_v_o1);

    /* "/home/jiba/src/soya/ode/space.pyx":194 */
    __pyx_v_g2 = dGeomGetData(__pyx_v_o2);

    /* "/home/jiba/src/soya/ode/space.pyx":195 */
    __pyx_1 = (PyObject *)__pyx_v_g1;
    Py_INCREF(__pyx_1);
    __pyx_3 = (PyObject *)__pyx_v_g2;
    Py_INCREF(__pyx_3);
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 195; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
    __pyx_1 = 0;
    __pyx_3 = 0;
    __pyx_1 = PyObject_CallObject(__pyx_v_callback, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 195; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
  }
  __pyx_L2:;

  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_WriteUnraisable("_ode.collide_callback");
  __pyx_L0:;
  Py_DECREF(__pyx_v_callback);
}

static PyObject *__pyx_f_4_ode_11SimpleSpace__create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4_ode_11SimpleSpace__create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  dSpaceID __pyx_v_sid;
  PyObject *__pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"space",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_space)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_space);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 211; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/space.pyx":214 */
  __pyx_1 = ((PyObject *)__pyx_v_space) == Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/space.pyx":215 */
    __pyx_v_sid = 0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/space.pyx":217 */
    __pyx_v_sid = __pyx_v_space->sid;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/space.pyx":219 */
  ((struct __pyx_obj_4_ode_SimpleSpace *)__pyx_v_self)->__pyx_base.sid = dSimpleSpaceCreate(__pyx_v_sid);

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

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

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.SimpleSpace._create");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_space);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_9HashSpace__create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4_ode_9HashSpace__create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  dSpaceID __pyx_v_sid;
  PyObject *__pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"space",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_space)) return 0;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_space);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 242; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/space.pyx":245 */
  __pyx_1 = ((PyObject *)__pyx_v_space) == Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/space.pyx":246 */
    __pyx_v_sid = 0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/space.pyx":248 */
    __pyx_v_sid = __pyx_v_space->sid;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/space.pyx":250 */
  ((struct __pyx_obj_4_ode_HashSpace *)__pyx_v_self)->__pyx_base.sid = dHashSpaceCreate(__pyx_v_sid);

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

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

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.HashSpace._create");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_space);
  return __pyx_r;
}

static PyObject *__pyx_k105p;

static char (__pyx_k105[]) = "minlevel (%d) must be less than or equal to maxlevel (%d)";

static PyObject *__pyx_f_4_ode_9HashSpace_setLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":265 */
  __pyx_1 = (__pyx_v_minlevel > __pyx_v_maxlevel);
  if (__pyx_1) {

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

  /* "/home/jiba/src/soya/ode/space.pyx":268 */
  dHashSpaceSetLevels(((struct __pyx_obj_4_ode_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_4_ode_9HashSpace_getLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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":280 */
  dHashSpaceGetLevels(((struct __pyx_obj_4_ode_HashSpace *)__pyx_v_self)->__pyx_base.sid,(&__pyx_v_minlevel),(&__pyx_v_maxlevel));

  /* "/home/jiba/src/soya/ode/space.pyx":281 */
  __pyx_1 = PyInt_FromLong(__pyx_v_minlevel); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 281; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(__pyx_v_maxlevel); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 281; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 281; 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_4_ode_10GeomSphere___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_10GeomSphere___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5_soya__World *__pyx_v_parent = 0;
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  PyObject *__pyx_v_radius = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  dSpaceID __pyx_v_sid;
  int __pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"parent","space","radius",0};
  __pyx_v_parent = __pyx_k57;
  __pyx_v_space = __pyx_k58;
  __pyx_v_radius = __pyx_k59;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_parent, &__pyx_v_space, &__pyx_v_radius)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_parent);
  Py_INCREF((PyObject *)__pyx_v_space);
  Py_INCREF(__pyx_v_radius);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_5_soya__World, 1, "parent")) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 16; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 16; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/geoms.pyx":19 */
  __pyx_1 = ((PyObject *)__pyx_v_space) != Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":20 */
    __pyx_v_sid = __pyx_v_space->sid;
    goto __pyx_L2;
  }
  /*else*/ {

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

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

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.GeomSphere.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_parent);
  Py_DECREF((PyObject *)__pyx_v_space);
  Py_DECREF(__pyx_v_radius);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static PyObject *__pyx_n_True;

static PyObject *__pyx_f_4_ode_10GeomSphere_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4_ode_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":27 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 27; 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 int __pyx_f_4_ode_10GeomSphere_6radius___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_radius); /*proto*/
static int __pyx_f_4_ode_10GeomSphere_6radius___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_radius) {
  double __pyx_v_radius;
  int __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_radius = PyFloat_AsDouble(__pyx_arg_radius); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 30; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/geoms.pyx":31 */
  dGeomSphereSetRadius(((struct __pyx_obj_4_ode_GeomSphere *)__pyx_v_self)->__pyx_base.gid,__pyx_v_radius);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.GeomSphere.radius.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_10GeomSphere_6radius___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_10GeomSphere_6radius___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geoms.pyx":34 */
  __pyx_1 = PyFloat_FromDouble(dGeomSphereGetRadius(((struct __pyx_obj_4_ode_GeomSphere *)__pyx_v_self)->__pyx_base.gid)); 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.radius.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static char (__pyx_k106[]) = "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 float __pyx_f_4_ode_10GeomSphere__point_depth(struct __pyx_obj_4_ode_GeomSphere *__pyx_v_self,float __pyx_v_x,float __pyx_v_y,float __pyx_v_z) {
  float __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geoms.pyx":37 */
  __pyx_k106;

  /* "/home/jiba/src/soya/ode/geoms.pyx":47 */
  __pyx_r = dGeomSpherePointDepth(__pyx_v_self->__pyx_base.gid,__pyx_v_x,__pyx_v_y,__pyx_v_z);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.GeomSphere._point_depth");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7GeomBox___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_7GeomBox___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5_soya__World *__pyx_v_parent = 0;
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  PyObject *__pyx_v_lengths = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  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[] = {"parent","space","lengths",0};
  __pyx_v_parent = __pyx_k60;
  __pyx_v_space = __pyx_k61;
  __pyx_v_lengths = __pyx_k62;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_parent, &__pyx_v_space, &__pyx_v_lengths)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_parent);
  Py_INCREF((PyObject *)__pyx_v_space);
  Py_INCREF(__pyx_v_lengths);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_5_soya__World, 1, "parent")) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 61; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 61; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/geoms.pyx":64 */
  __pyx_1 = ((PyObject *)__pyx_v_space) != Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":65 */
    __pyx_v_sid = __pyx_v_space->sid;
    goto __pyx_L2;
  }
  /*else*/ {

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

  /* "/home/jiba/src/soya/ode/geoms.pyx":69 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_lengths, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; 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 = 69; 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 = 69; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_lengths, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; 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 = 69; 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 = 69; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_lengths, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; 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 = 69; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  ((struct __pyx_obj_4_ode_GeomBox *)__pyx_v_self)->__pyx_base.gid = dCreateBox(__pyx_v_sid,__pyx_4,__pyx_5,__pyx_6);

  __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_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_parent);
  Py_DECREF((PyObject *)__pyx_v_space);
  Py_DECREF(__pyx_v_lengths);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7GeomBox_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4_ode_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":72 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 72; 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_4_ode_7GeomBox_setLengths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4_ode_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":75 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_lengths, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; 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 = 75; 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 = 75; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_lengths, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; 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 = 75; 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 = 75; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_lengths, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; 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 = 75; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dGeomBoxSetLengths(((struct __pyx_obj_4_ode_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_4_ode_7GeomBox_getLengths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4_ode_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":79 */
  dGeomBoxGetLengths(((struct __pyx_obj_4_ode_GeomBox *)__pyx_v_self)->__pyx_base.gid,__pyx_v_res);

  /* "/home/jiba/src/soya/ode/geoms.pyx":80 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 80; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 80; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 80; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 80; 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 char (__pyx_k107[]) = "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 float __pyx_f_4_ode_7GeomBox__point_depth(struct __pyx_obj_4_ode_GeomBox *__pyx_v_self,float __pyx_v_x,float __pyx_v_y,float __pyx_v_z) {
  float __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geoms.pyx":83 */
  __pyx_k107;

  /* "/home/jiba/src/soya/ode/geoms.pyx":93 */
  __pyx_r = dGeomBoxPointDepth(__pyx_v_self->__pyx_base.gid,__pyx_v_x,__pyx_v_y,__pyx_v_z);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.GeomBox._point_depth");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_9GeomPlane___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_9GeomPlane___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5_soya__World *__pyx_v_parent = 0;
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  PyObject *__pyx_v_normal = 0;
  PyObject *__pyx_v_dist = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  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[] = {"parent","space","normal","dist",0};
  __pyx_v_parent = __pyx_k63;
  __pyx_v_space = __pyx_k64;
  __pyx_v_normal = __pyx_k65;
  __pyx_v_dist = __pyx_k66;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 4, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOO", __pyx_argnames, &__pyx_v_parent, &__pyx_v_space, &__pyx_v_normal, &__pyx_v_dist)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_parent);
  Py_INCREF((PyObject *)__pyx_v_space);
  Py_INCREF(__pyx_v_normal);
  Py_INCREF(__pyx_v_dist);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_5_soya__World, 1, "parent")) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 112; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 112; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/geoms.pyx":115 */
  __pyx_1 = ((PyObject *)__pyx_v_space) != Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":116 */
    __pyx_v_sid = __pyx_v_space->sid;
    goto __pyx_L2;
  }
  /*else*/ {

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

  /* "/home/jiba/src/soya/ode/geoms.pyx":120 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 120; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_normal, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 120; 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 = 120; 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 = 120; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_normal, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 120; 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 = 120; 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 = 120; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_normal, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 120; 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 = 120; 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 = 120; goto __pyx_L1;}
  ((struct __pyx_obj_4_ode_GeomPlane *)__pyx_v_self)->__pyx_base.gid = dCreatePlane(__pyx_v_sid,__pyx_4,__pyx_5,__pyx_6,__pyx_7);

  __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_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_parent);
  Py_DECREF((PyObject *)__pyx_v_space);
  Py_DECREF(__pyx_v_normal);
  Py_DECREF(__pyx_v_dist);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static int __pyx_f_4_ode_9GeomPlane_6params___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_params); /*proto*/
static int __pyx_f_4_ode_9GeomPlane_6params___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_params) {
  PyObject *__pyx_v_normal;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  dReal __pyx_5;
  dReal __pyx_6;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_params);
  __pyx_v_normal = Py_None; Py_INCREF(__pyx_v_normal);

  /* "/home/jiba/src/soya/ode/geoms.pyx":124 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 124; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_params, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 124; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_normal);
  __pyx_v_normal = __pyx_2;
  __pyx_2 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":125 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 125; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __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[7]; __pyx_lineno = 125; 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 = 125; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 125; 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 = 125; 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 = 125; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_normal, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 125; 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 = 125; 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 = 125; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_params, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 125; 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 = 125; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dGeomPlaneSetParams(((struct __pyx_obj_4_ode_GeomPlane *)__pyx_v_self)->__pyx_base.gid,__pyx_3,__pyx_4,__pyx_5,__pyx_6);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode.GeomPlane.params.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_normal);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_params);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_9GeomPlane_6params___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_9GeomPlane_6params___get__(PyObject *__pyx_v_self) {
  dVector4 __pyx_v_res;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geoms.pyx":129 */
  dGeomPlaneGetParams(((struct __pyx_obj_4_ode_GeomPlane *)__pyx_v_self)->__pyx_base.gid,__pyx_v_res);

  /* "/home/jiba/src/soya/ode/geoms.pyx":130 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_res[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_res[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_res[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; 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 = 130; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; 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.params.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static char (__pyx_k108[]) = "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 float __pyx_f_4_ode_9GeomPlane__point_depth(struct __pyx_obj_4_ode_GeomPlane *__pyx_v_self,float __pyx_v_x,float __pyx_v_y,float __pyx_v_z) {
  float __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geoms.pyx":133 */
  __pyx_k108;

  /* "/home/jiba/src/soya/ode/geoms.pyx":143 */
  __pyx_r = dGeomPlanePointDepth(__pyx_v_self->__pyx_base.gid,__pyx_v_x,__pyx_v_y,__pyx_v_z);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.GeomPlane._point_depth");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_13GeomCCylinder___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_13GeomCCylinder___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5_soya__World *__pyx_v_parent = 0;
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  PyObject *__pyx_v_radius = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  dSpaceID __pyx_v_sid;
  int __pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  dReal __pyx_3;
  static char *__pyx_argnames[] = {"parent","space","radius","length",0};
  __pyx_v_parent = __pyx_k67;
  __pyx_v_space = __pyx_k68;
  __pyx_v_radius = __pyx_k69;
  __pyx_v_length = __pyx_k70;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 4, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOO", __pyx_argnames, &__pyx_v_parent, &__pyx_v_space, &__pyx_v_radius, &__pyx_v_length)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_parent);
  Py_INCREF((PyObject *)__pyx_v_space);
  Py_INCREF(__pyx_v_radius);
  Py_INCREF(__pyx_v_length);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_5_soya__World, 1, "parent")) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/geoms.pyx":163 */
  __pyx_1 = ((PyObject *)__pyx_v_space) != Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":164 */
    __pyx_v_sid = __pyx_v_space->sid;
    goto __pyx_L2;
  }
  /*else*/ {

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

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

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.GeomCCylinder.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_parent);
  Py_DECREF((PyObject *)__pyx_v_space);
  Py_DECREF(__pyx_v_radius);
  Py_DECREF(__pyx_v_length);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_13GeomCCylinder_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4_ode_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":171 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 171; 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 int __pyx_f_4_ode_13GeomCCylinder_6params___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_params); /*proto*/
static int __pyx_f_4_ode_13GeomCCylinder_6params___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_params) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  dReal __pyx_3;
  dReal __pyx_4;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_params);

  /* "/home/jiba/src/soya/ode/geoms.pyx":175 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 175; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_params, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 175; 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 = 175; 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 = 175; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_params, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 175; 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 = 175; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dGeomCCylinderSetParams(((struct __pyx_obj_4_ode_GeomCCylinder *)__pyx_v_self)->__pyx_base.gid,__pyx_3,__pyx_4);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_ode.GeomCCylinder.params.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_params);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_13GeomCCylinder_6params___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_13GeomCCylinder_6params___get__(PyObject *__pyx_v_self) {
  dReal __pyx_v_radius;
  dReal __pyx_v_length;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geoms.pyx":179 */
  dGeomCCylinderGetParams(((struct __pyx_obj_4_ode_GeomCCylinder *)__pyx_v_self)->__pyx_base.gid,(&__pyx_v_radius),(&__pyx_v_length));

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

static char (__pyx_k109[]) = "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 float __pyx_f_4_ode_13GeomCCylinder__point_depth(struct __pyx_obj_4_ode_GeomCCylinder *__pyx_v_self,float __pyx_v_x,float __pyx_v_y,float __pyx_v_z) {
  float __pyx_r;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geoms.pyx":183 */
  __pyx_k109;

  /* "/home/jiba/src/soya/ode/geoms.pyx":193 */
  __pyx_r = dGeomCCylinderPointDepth(__pyx_v_self->__pyx_base.gid,__pyx_v_x,__pyx_v_y,__pyx_v_z);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.GeomCCylinder._point_depth");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_7GeomRay___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_7GeomRay___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5_soya__World *__pyx_v_parent = 0;
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  PyObject *__pyx_v_rlen = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  dSpaceID __pyx_v_sid;
  int __pyx_r;
  int __pyx_1;
  dReal __pyx_2;
  static char *__pyx_argnames[] = {"parent","space","rlen",0};
  __pyx_v_parent = __pyx_k71;
  __pyx_v_space = __pyx_k72;
  __pyx_v_rlen = __pyx_k73;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_parent, &__pyx_v_space, &__pyx_v_rlen)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_parent);
  Py_INCREF((PyObject *)__pyx_v_space);
  Py_INCREF(__pyx_v_rlen);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_5_soya__World, 1, "parent")) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 211; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 211; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/geoms.pyx":214 */
  __pyx_1 = ((PyObject *)__pyx_v_space) != Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/geoms.pyx":215 */
    __pyx_v_sid = __pyx_v_space->sid;
    goto __pyx_L2;
  }
  /*else*/ {

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

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

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.GeomRay.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_parent);
  Py_DECREF((PyObject *)__pyx_v_space);
  Py_DECREF(__pyx_v_rlen);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static int __pyx_f_4_ode_7GeomRay_6length___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_rlen); /*proto*/
static int __pyx_f_4_ode_7GeomRay_6length___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_rlen) {
  int __pyx_r;
  dReal __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_rlen);

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

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode.GeomRay.length.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_rlen);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7GeomRay_6length___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_4_ode_7GeomRay_6length___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/geoms.pyx":226 */
  __pyx_1 = PyFloat_FromDouble(dGeomRayGetLength(((struct __pyx_obj_4_ode_GeomRay *)__pyx_v_self)->__pyx_base.gid)); 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.GeomRay.length.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_7GeomRay_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4_ode_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":229 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 229; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 229; 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 = 229; 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 = 229; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 229; 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 = 229; 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 = 229; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 229; 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 = 229; 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 = 229; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_u, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 229; 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 = 229; 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 = 229; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_u, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 229; 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 = 229; 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 = 229; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_u, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 229; 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 = 229; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  dGeomRaySet(((struct __pyx_obj_4_ode_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_4_ode_7GeomRay_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4_ode_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":234 */
  dGeomRayGet(((struct __pyx_obj_4_ode_GeomRay *)__pyx_v_self)->__pyx_base.gid,__pyx_v_start,__pyx_v_dir);

  /* "/home/jiba/src/soya/ode/geoms.pyx":235 */
  __pyx_1 = PyFloat_FromDouble((__pyx_v_start[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 235; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_start[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 235; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_start[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 235; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 235; 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 = 235; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble((__pyx_v_dir[1])); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 235; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble((__pyx_v_dir[2])); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 235; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 235; 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 = 235; 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 char (__pyx_k110[]) = "Check for collision with one triangle edge. Uses a normal\n		that\'s halfway between the precomputed normals of the vertices\n		that make up the edge.";

static int __pyx_f_4_ode_collide_edge(GLfloat (*__pyx_v_A),GLfloat (*__pyx_v_B),GLfloat (*__pyx_v_AB),GLfloat (*__pyx_v_normalA),GLfloat (*__pyx_v_normalB),dGeomID __pyx_v_o1,dGeomID __pyx_v_o2,int __pyx_v_max_contacts,int __pyx_v_flags,dContactGeom (*__pyx_v_contact)) {
  int __pyx_v_n;
  int __pyx_v_num_contacts;
  int __pyx_v_nA;
  int __pyx_v_nB;
  dContactGeom __pyx_v_contactA;
  dContactGeom __pyx_v_contactB;
  struct __pyx_obj_4_ode_GeomObject *__pyx_v_other;
  int __pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  __pyx_v_other = Py_None; Py_INCREF((PyObject *) __pyx_v_other);

  /* "/home/jiba/src/soya/ode/util.pyx":27 */
  __pyx_k110;

  /* "/home/jiba/src/soya/ode/util.pyx":36 */
  dGeomRaySetLength(__pyx_v_4_ode__terrain_ray,point_distance_to(__pyx_v_A,__pyx_v_B));

  /* "/home/jiba/src/soya/ode/util.pyx":37 */
  dGeomRaySet(__pyx_v_4_ode__terrain_ray,(__pyx_v_A[0]),(__pyx_v_A[1]),(__pyx_v_A[2]),(__pyx_v_AB[0]),(__pyx_v_AB[1]),(__pyx_v_AB[2]));

  /* "/home/jiba/src/soya/ode/util.pyx":38 */
  __pyx_v_nA = dCollide(__pyx_v_4_ode__terrain_ray,__pyx_v_o2,__pyx_v_flags,(&__pyx_v_contactA),(sizeof(dContactGeom )));

  /* "/home/jiba/src/soya/ode/util.pyx":41 */
  dGeomRaySet(__pyx_v_4_ode__terrain_ray,(__pyx_v_B[0]),(__pyx_v_B[1]),(__pyx_v_B[2]),(-(__pyx_v_AB[0])),(-(__pyx_v_AB[1])),(-(__pyx_v_AB[2])));

  /* "/home/jiba/src/soya/ode/util.pyx":42 */
  __pyx_v_nB = dCollide(__pyx_v_4_ode__terrain_ray,__pyx_v_o2,__pyx_v_flags,(&__pyx_v_contactB),(sizeof(dContactGeom )));

  /* "/home/jiba/src/soya/ode/util.pyx":44 */
  __pyx_1 = __pyx_v_nA;
  if (__pyx_1) {
    __pyx_1 = __pyx_v_nB;
  }
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/util.pyx":45 */
    (__pyx_v_contact->pos[0]) = (((__pyx_v_contactA.pos[0]) + (__pyx_v_contactB.pos[0])) / 2.0);

    /* "/home/jiba/src/soya/ode/util.pyx":46 */
    (__pyx_v_contact->pos[1]) = (((__pyx_v_contactA.pos[1]) + (__pyx_v_contactB.pos[1])) / 2.0);

    /* "/home/jiba/src/soya/ode/util.pyx":47 */
    (__pyx_v_contact->pos[2]) = (((__pyx_v_contactA.pos[2]) + (__pyx_v_contactB.pos[2])) / 2.0);

    /* "/home/jiba/src/soya/ode/util.pyx":50 */
    (__pyx_v_contact->normal[0]) = (((__pyx_v_normalA[0]) + (__pyx_v_normalB[0])) / 2.0);

    /* "/home/jiba/src/soya/ode/util.pyx":51 */
    (__pyx_v_contact->normal[1]) = (((__pyx_v_normalA[1]) + (__pyx_v_normalB[1])) / 2.0);

    /* "/home/jiba/src/soya/ode/util.pyx":52 */
    (__pyx_v_contact->normal[2]) = (((__pyx_v_normalA[2]) + (__pyx_v_normalB[2])) / 2.0);

    /* "/home/jiba/src/soya/ode/util.pyx":55 */
    __pyx_2 = (PyObject *)dGeomGetData(__pyx_v_o2);
    Py_INCREF((PyObject *)__pyx_2);
    Py_DECREF((PyObject *)((PyObject *)__pyx_v_other));
    __pyx_v_other = __pyx_2;
    __pyx_2 = 0;

    /* "/home/jiba/src/soya/ode/util.pyx":56 */
    __pyx_v_contact->depth = ((struct __pyx_vtabstruct_4_ode_GeomObject *)__pyx_v_other->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_point_depth(__pyx_v_other,(__pyx_v_contact->pos[0]),(__pyx_v_contact->pos[1]),(__pyx_v_contact->pos[2]));

    /* "/home/jiba/src/soya/ode/util.pyx":58 */
    __pyx_v_contact->g1 = __pyx_v_o1;

    /* "/home/jiba/src/soya/ode/util.pyx":59 */
    __pyx_v_contact->g2 = __pyx_v_o2;

    /* "/home/jiba/src/soya/ode/util.pyx":61 */
    __pyx_r = 1;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

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

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_WriteUnraisable("_ode.collide_edge");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_other);
  return __pyx_r;
}

static PyObject *__pyx_k112p;

static char (__pyx_k111[]) = "Get the axis-aligned bounding box.\n				This is slow and it\'s fortunate that terrains aren\'t currently considered\n				placeable so it only gets called once. If we want terrains to be\n				placeable, we need to cache the information and invalidate it\n				if the terrain is moved. This may require going back to subclassing\n				_soya._Terrain, or coming up with a hook mechanism for getting notified\n				when a coordsyst is updated.";
static char (__pyx_k112[]) = "Calculating AABB for terrain (slow)";

static void __pyx_f_4_ode_8_Terrain__get_aabb(struct __pyx_obj_4_ode__Terrain *__pyx_v_self,dReal (*__pyx_v_aabb)) {
  struct __pyx_obj_5_soya__Terrain *__pyx_v_terrain;
  float __pyx_v_min_x;
  float __pyx_v_max_x;
  float __pyx_v_min_y;
  float __pyx_v_max_y;
  float __pyx_v_min_z;
  float __pyx_v_max_z;
  int __pyx_v_i;
  GLfloat (__pyx_v_m[19]);
  GLfloat (__pyx_v_P[3]);
  int __pyx_1;
  int __pyx_2;
  Py_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_terrain = Py_None; Py_INCREF((PyObject *) __pyx_v_terrain);

  /* "/home/jiba/src/soya/ode/terrain.pyx":61 */
  __pyx_k111;

  /* "/home/jiba/src/soya/ode/terrain.pyx":74 */
  Py_INCREF(((PyObject *)__pyx_v_self->_terrain));
  Py_DECREF((PyObject *)((PyObject *)__pyx_v_terrain));
  __pyx_v_terrain = ((PyObject *)__pyx_v_self->_terrain);

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

  /* "/home/jiba/src/soya/ode/terrain.pyx":81 */
  multiply_matrix(__pyx_v_m,((struct __pyx_vtabstruct_5_soya__Terrain *)__pyx_v_terrain->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base._root_matrix(((struct __pyx_obj_5_soya_CoordSyst *)__pyx_v_terrain)),((struct __pyx_vtabstruct_4_ode__World *)__pyx_v_self->__pyx_base.world->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base._inverted_root_matrix(((struct __pyx_obj_5_soya_CoordSyst *)__pyx_v_self->__pyx_base.world)));

  /* "/home/jiba/src/soya/ode/terrain.pyx":84 */
  point_by_matrix_copy(__pyx_v_P,(__pyx_v_terrain->_vertices[0]).coord,__pyx_v_m);

  /* "/home/jiba/src/soya/ode/terrain.pyx":85 */
  __pyx_v_min_x = (__pyx_v_P[0]);

  /* "/home/jiba/src/soya/ode/terrain.pyx":86 */
  __pyx_v_max_x = (__pyx_v_P[0]);

  /* "/home/jiba/src/soya/ode/terrain.pyx":87 */
  __pyx_v_min_y = (__pyx_v_P[1]);

  /* "/home/jiba/src/soya/ode/terrain.pyx":88 */
  __pyx_v_max_y = (__pyx_v_P[1]);

  /* "/home/jiba/src/soya/ode/terrain.pyx":89 */
  __pyx_v_min_z = (__pyx_v_P[2]);

  /* "/home/jiba/src/soya/ode/terrain.pyx":90 */
  __pyx_v_max_z = (__pyx_v_P[2]);

  /* "/home/jiba/src/soya/ode/terrain.pyx":92 */
  __pyx_1 = (__pyx_v_terrain->_nb_vertex_width * __pyx_v_terrain->_nb_vertex_depth);
  for (__pyx_v_i = 1; __pyx_v_i < __pyx_1; ++__pyx_v_i) {

    /* "/home/jiba/src/soya/ode/terrain.pyx":94 */
    point_by_matrix_copy(__pyx_v_P,(__pyx_v_terrain->_vertices[__pyx_v_i]).coord,__pyx_v_m);

    /* "/home/jiba/src/soya/ode/terrain.pyx":95 */
    __pyx_2 = ((__pyx_v_P[0]) < __pyx_v_min_x);
    if (__pyx_2) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":96 */
      __pyx_v_min_x = (__pyx_v_P[0]);
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/jiba/src/soya/ode/terrain.pyx":98 */
    __pyx_2 = ((__pyx_v_P[0]) > __pyx_v_max_x);
    if (__pyx_2) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":99 */
      __pyx_v_max_x = (__pyx_v_P[0]);
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/jiba/src/soya/ode/terrain.pyx":101 */
    __pyx_2 = ((__pyx_v_P[1]) < __pyx_v_min_y);
    if (__pyx_2) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":102 */
      __pyx_v_min_y = (__pyx_v_P[1]);
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/jiba/src/soya/ode/terrain.pyx":104 */
    __pyx_2 = ((__pyx_v_P[1]) > __pyx_v_max_y);
    if (__pyx_2) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":105 */
      __pyx_v_max_y = (__pyx_v_P[1]);
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/jiba/src/soya/ode/terrain.pyx":107 */
    __pyx_2 = ((__pyx_v_P[2]) < __pyx_v_min_z);
    if (__pyx_2) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":108 */
      __pyx_v_min_z = (__pyx_v_P[2]);
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/jiba/src/soya/ode/terrain.pyx":110 */
    __pyx_2 = ((__pyx_v_P[2]) > __pyx_v_max_z);
    if (__pyx_2) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":111 */
      __pyx_v_max_z = (__pyx_v_P[2]);
      goto __pyx_L9;
    }
    __pyx_L9:;
    __pyx_L2:;
  }
  __pyx_L3:;

  /* "/home/jiba/src/soya/ode/terrain.pyx":113 */
  (__pyx_v_aabb[0]) = __pyx_v_min_x;

  /* "/home/jiba/src/soya/ode/terrain.pyx":114 */
  (__pyx_v_aabb[1]) = __pyx_v_max_x;

  /* "/home/jiba/src/soya/ode/terrain.pyx":115 */
  (__pyx_v_aabb[2]) = __pyx_v_min_y;

  /* "/home/jiba/src/soya/ode/terrain.pyx":116 */
  (__pyx_v_aabb[3]) = __pyx_v_max_y;

  /* "/home/jiba/src/soya/ode/terrain.pyx":117 */
  (__pyx_v_aabb[4]) = __pyx_v_min_z;

  /* "/home/jiba/src/soya/ode/terrain.pyx":118 */
  (__pyx_v_aabb[5]) = __pyx_v_max_z;

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode._Terrain._get_aabb");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_terrain);
  Py_DECREF((PyObject *)__pyx_v_self);
}

static char (__pyx_k113[]) = "Test for any collisions within a single cell of the heightfield\n				grid.";

static int __pyx_f_4_ode_8_Terrain__collide_cell(struct __pyx_obj_4_ode__Terrain *__pyx_v_self,int __pyx_v_x,int __pyx_v_z,dGeomID __pyx_v_o1,dGeomID __pyx_v_o2,int __pyx_v_max_contacts,int __pyx_v_flags,dContactGeom (*__pyx_v_contact),int __pyx_v_skip) {
  __pyx_t_5_soya_TerrainVertex (*__pyx_v_vA);
  __pyx_t_5_soya_TerrainVertex (*__pyx_v_vB);
  __pyx_t_5_soya_TerrainVertex (*__pyx_v_vC);
  __pyx_t_5_soya_TerrainVertex (*__pyx_v_vD);
  GLfloat (__pyx_v_A[3]);
  GLfloat (__pyx_v_B[3]);
  GLfloat (__pyx_v_C[3]);
  GLfloat (__pyx_v_D[3]);
  GLfloat (__pyx_v_NB[3]);
  GLfloat (__pyx_v_NC[3]);
  GLfloat (__pyx_v_ND[3]);
  GLfloat (__pyx_v_AB[3]);
  GLfloat (__pyx_v_AC[3]);
  GLfloat (__pyx_v_BC[3]);
  GLfloat (__pyx_v_BD[3]);
  GLfloat (__pyx_v_CD[3]);
  GLfloat (__pyx_v_plane[4]);
  int __pyx_v_num_contacts;
  int __pyx_v_numPlaneContacts;
  dContactGeom (__pyx_v_ContactA[3]);
  dContactGeom (__pyx_v_ContactB[3]);
  dContactGeom (*__pyx_v_pContact);
  dContactGeom (__pyx_v_planeContact[10]);
  GLfloat (__pyx_v_m[19]);
  struct __pyx_obj_5_soya__Terrain *__pyx_v_terrain;
  PyObject *__pyx_v_i;
  int __pyx_r;
  int __pyx_1;
  long __pyx_2;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  int __pyx_5;
  Py_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_terrain = Py_None; Py_INCREF((PyObject *) __pyx_v_terrain);
  __pyx_v_i = Py_None; Py_INCREF(__pyx_v_i);

  /* "/home/jiba/src/soya/ode/terrain.pyx":123 */
  __pyx_k113;

  /* "/home/jiba/src/soya/ode/terrain.pyx":136 */
  __pyx_v_num_contacts = 0;

  /* "/home/jiba/src/soya/ode/terrain.pyx":138 */
  Py_INCREF(((PyObject *)__pyx_v_self->_terrain));
  Py_DECREF((PyObject *)((PyObject *)__pyx_v_terrain));
  __pyx_v_terrain = ((PyObject *)__pyx_v_self->_terrain);

  /* "/home/jiba/src/soya/ode/terrain.pyx":140 */
  multiply_matrix(__pyx_v_m,((struct __pyx_vtabstruct_5_soya__Terrain *)__pyx_v_terrain->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base._root_matrix(((struct __pyx_obj_5_soya_CoordSyst *)__pyx_v_terrain)),((struct __pyx_vtabstruct_4_ode__World *)__pyx_v_self->__pyx_base.world->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base._inverted_root_matrix(((struct __pyx_obj_5_soya_CoordSyst *)__pyx_v_self->__pyx_base.world)));

  /* "/home/jiba/src/soya/ode/terrain.pyx":144 */
  __pyx_v_vA = (__pyx_v_terrain->_vertices + (__pyx_v_x + (__pyx_v_z * __pyx_v_terrain->_nb_vertex_width)));

  /* "/home/jiba/src/soya/ode/terrain.pyx":145 */
  __pyx_v_vB = (__pyx_v_vA + 1);

  /* "/home/jiba/src/soya/ode/terrain.pyx":146 */
  __pyx_v_vC = (__pyx_v_vA + __pyx_v_terrain->_nb_vertex_width);

  /* "/home/jiba/src/soya/ode/terrain.pyx":147 */
  __pyx_v_vD = (__pyx_v_vB + __pyx_v_terrain->_nb_vertex_width);

  /* "/home/jiba/src/soya/ode/terrain.pyx":153 */
  point_by_matrix_copy(__pyx_v_A,__pyx_v_vA->coord,__pyx_v_m);

  /* "/home/jiba/src/soya/ode/terrain.pyx":154 */
  point_by_matrix_copy(__pyx_v_B,__pyx_v_vB->coord,__pyx_v_m);

  /* "/home/jiba/src/soya/ode/terrain.pyx":155 */
  point_by_matrix_copy(__pyx_v_C,__pyx_v_vC->coord,__pyx_v_m);

  /* "/home/jiba/src/soya/ode/terrain.pyx":156 */
  point_by_matrix_copy(__pyx_v_D,__pyx_v_vD->coord,__pyx_v_m);

  /* "/home/jiba/src/soya/ode/terrain.pyx":159 */
  point_by_matrix_copy(__pyx_v_NB,__pyx_v_vB->normal,__pyx_v_m);

  /* "/home/jiba/src/soya/ode/terrain.pyx":160 */
  point_by_matrix_copy(__pyx_v_NC,__pyx_v_vC->normal,__pyx_v_m);

  /* "/home/jiba/src/soya/ode/terrain.pyx":161 */
  point_by_matrix_copy(__pyx_v_ND,__pyx_v_vD->normal,__pyx_v_m);

  /* "/home/jiba/src/soya/ode/terrain.pyx":165 */
  vector_normalize(__pyx_v_NB);

  /* "/home/jiba/src/soya/ode/terrain.pyx":166 */
  vector_normalize(__pyx_v_NC);

  /* "/home/jiba/src/soya/ode/terrain.pyx":167 */
  vector_normalize(__pyx_v_ND);

  /* "/home/jiba/src/soya/ode/terrain.pyx":171 */
  vector_from_points(__pyx_v_AB,__pyx_v_A,__pyx_v_B);

  /* "/home/jiba/src/soya/ode/terrain.pyx":172 */
  vector_normalize(__pyx_v_AB);

  /* "/home/jiba/src/soya/ode/terrain.pyx":173 */
  vector_from_points(__pyx_v_AC,__pyx_v_A,__pyx_v_C);

  /* "/home/jiba/src/soya/ode/terrain.pyx":174 */
  vector_normalize(__pyx_v_AC);

  /* "/home/jiba/src/soya/ode/terrain.pyx":175 */
  vector_from_points(__pyx_v_BC,__pyx_v_B,__pyx_v_C);

  /* "/home/jiba/src/soya/ode/terrain.pyx":176 */
  vector_normalize(__pyx_v_BC);

  /* "/home/jiba/src/soya/ode/terrain.pyx":177 */
  vector_from_points(__pyx_v_BD,__pyx_v_B,__pyx_v_D);

  /* "/home/jiba/src/soya/ode/terrain.pyx":178 */
  vector_normalize(__pyx_v_BD);

  /* "/home/jiba/src/soya/ode/terrain.pyx":179 */
  vector_from_points(__pyx_v_CD,__pyx_v_C,__pyx_v_D);

  /* "/home/jiba/src/soya/ode/terrain.pyx":180 */
  vector_normalize(__pyx_v_CD);

  /* "/home/jiba/src/soya/ode/terrain.pyx":184 */
  __pyx_v_num_contacts = (__pyx_v_num_contacts + __pyx_f_4_ode_collide_edge(__pyx_v_B,__pyx_v_C,__pyx_v_BC,__pyx_v_NB,__pyx_v_NC,__pyx_v_o1,__pyx_v_o2,(__pyx_v_max_contacts - __pyx_v_num_contacts),__pyx_v_flags,((dContactGeom (*))(((char (*))__pyx_v_contact) + (__pyx_v_num_contacts * __pyx_v_skip)))));

  /* "/home/jiba/src/soya/ode/terrain.pyx":188 */
  __pyx_1 = (__pyx_v_num_contacts == __pyx_v_max_contacts);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/terrain.pyx":189 */
    __pyx_r = __pyx_v_num_contacts;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/terrain.pyx":191 */
  __pyx_v_num_contacts = (__pyx_v_num_contacts + __pyx_f_4_ode_collide_edge(__pyx_v_B,__pyx_v_D,__pyx_v_BD,__pyx_v_NB,__pyx_v_ND,__pyx_v_o1,__pyx_v_o2,(__pyx_v_max_contacts - __pyx_v_num_contacts),__pyx_v_flags,((dContactGeom (*))(((char (*))__pyx_v_contact) + (__pyx_v_num_contacts * __pyx_v_skip)))));

  /* "/home/jiba/src/soya/ode/terrain.pyx":195 */
  __pyx_1 = (__pyx_v_num_contacts == __pyx_v_max_contacts);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/terrain.pyx":196 */
    __pyx_r = __pyx_v_num_contacts;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/jiba/src/soya/ode/terrain.pyx":198 */
  __pyx_v_num_contacts = (__pyx_v_num_contacts + __pyx_f_4_ode_collide_edge(__pyx_v_C,__pyx_v_D,__pyx_v_CD,__pyx_v_NC,__pyx_v_ND,__pyx_v_o1,__pyx_v_o2,(__pyx_v_max_contacts - __pyx_v_num_contacts),__pyx_v_flags,((dContactGeom (*))(((char (*))__pyx_v_contact) + (__pyx_v_num_contacts * __pyx_v_skip)))));

  /* "/home/jiba/src/soya/ode/terrain.pyx":202 */
  __pyx_1 = (__pyx_v_num_contacts == __pyx_v_max_contacts);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/terrain.pyx":203 */
    __pyx_r = __pyx_v_num_contacts;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/jiba/src/soya/ode/terrain.pyx":207 */
  vector_cross_product(__pyx_v_plane,__pyx_v_AC,__pyx_v_AB);

  /* "/home/jiba/src/soya/ode/terrain.pyx":209 */
  (__pyx_v_plane[3]) = ((((__pyx_v_plane[0]) * (__pyx_v_A[0])) + ((__pyx_v_plane[1]) * (__pyx_v_A[1]))) + ((__pyx_v_plane[2]) * (__pyx_v_A[2])));

  /* "/home/jiba/src/soya/ode/terrain.pyx":210 */
  dGeomPlaneSetParams(__pyx_v_4_ode__terrain_plane,(__pyx_v_plane[0]),(__pyx_v_plane[1]),(__pyx_v_plane[2]),(__pyx_v_plane[3]));

  /* "/home/jiba/src/soya/ode/terrain.pyx":212 */
  __pyx_v_numPlaneContacts = dCollide(__pyx_v_o2,__pyx_v_4_ode__terrain_plane,__pyx_v_flags,__pyx_v_planeContact,(sizeof(dContactGeom )));

  /* "/home/jiba/src/soya/ode/terrain.pyx":216 */
  for (__pyx_2 = 0; __pyx_2 < __pyx_v_numPlaneContacts; ++__pyx_2) {
    __pyx_3 = PyInt_FromLong(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 216; goto __pyx_L1;}
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_3;
    __pyx_3 = 0;

    /* "/home/jiba/src/soya/ode/terrain.pyx":222 */
    __pyx_4 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 222; goto __pyx_L1;}
    __pyx_1 = (((__pyx_v_planeContact[__pyx_4]).pos[0]) < (__pyx_v_A[0]));
    if (!__pyx_1) {
      __pyx_4 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 222; goto __pyx_L1;}
      __pyx_1 = (((__pyx_v_planeContact[__pyx_4]).pos[0]) > (__pyx_v_D[0]));
    }
    if (__pyx_1) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":223 */
      goto __pyx_L5;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/jiba/src/soya/ode/terrain.pyx":225 */
    __pyx_1 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 225; goto __pyx_L1;}
    __pyx_4 = (((__pyx_v_planeContact[__pyx_1]).pos[2]) < (__pyx_v_A[2]));
    if (!__pyx_4) {
      __pyx_1 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 225; goto __pyx_L1;}
      __pyx_4 = (((__pyx_v_planeContact[__pyx_1]).pos[2]) > (__pyx_v_D[2]));
    }
    if (__pyx_4) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":226 */
      goto __pyx_L5;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/jiba/src/soya/ode/terrain.pyx":230 */
    __pyx_1 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 230; goto __pyx_L1;}
    __pyx_4 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 230; goto __pyx_L1;}
    __pyx_5 = ((((((__pyx_v_planeContact[__pyx_1]).pos[0]) - (__pyx_v_A[0])) + ((__pyx_v_planeContact[__pyx_4]).pos[2])) - (__pyx_v_A[2])) > ((__pyx_v_D[0]) - (__pyx_v_A[0])));
    if (__pyx_5) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":231 */
      goto __pyx_L5;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "/home/jiba/src/soya/ode/terrain.pyx":234 */
    __pyx_v_pContact = ((dContactGeom (*))(((char (*))__pyx_v_contact) + (__pyx_v_num_contacts * __pyx_v_skip)));

    /* "/home/jiba/src/soya/ode/terrain.pyx":236 */
    __pyx_1 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 236; goto __pyx_L1;}
    (__pyx_v_pContact->pos[0]) = ((__pyx_v_planeContact[__pyx_1]).pos[0]);

    /* "/home/jiba/src/soya/ode/terrain.pyx":237 */
    __pyx_4 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 237; goto __pyx_L1;}
    (__pyx_v_pContact->pos[1]) = ((__pyx_v_planeContact[__pyx_4]).pos[1]);

    /* "/home/jiba/src/soya/ode/terrain.pyx":238 */
    __pyx_5 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 238; goto __pyx_L1;}
    (__pyx_v_pContact->pos[2]) = ((__pyx_v_planeContact[__pyx_5]).pos[2]);

    /* "/home/jiba/src/soya/ode/terrain.pyx":239 */
    __pyx_1 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 239; goto __pyx_L1;}
    (__pyx_v_pContact->normal[0]) = (-((__pyx_v_planeContact[__pyx_1]).normal[0]));

    /* "/home/jiba/src/soya/ode/terrain.pyx":240 */
    __pyx_4 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 240; goto __pyx_L1;}
    (__pyx_v_pContact->normal[1]) = (-((__pyx_v_planeContact[__pyx_4]).normal[1]));

    /* "/home/jiba/src/soya/ode/terrain.pyx":241 */
    __pyx_5 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 241; goto __pyx_L1;}
    (__pyx_v_pContact->normal[2]) = (-((__pyx_v_planeContact[__pyx_5]).normal[2]));

    /* "/home/jiba/src/soya/ode/terrain.pyx":242 */
    __pyx_1 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 242; goto __pyx_L1;}
    __pyx_v_pContact->depth = (__pyx_v_planeContact[__pyx_1]).depth;

    /* "/home/jiba/src/soya/ode/terrain.pyx":243 */
    __pyx_v_pContact->g1 = __pyx_v_o1;

    /* "/home/jiba/src/soya/ode/terrain.pyx":244 */
    __pyx_v_pContact->g2 = __pyx_v_o2;

    /* "/home/jiba/src/soya/ode/terrain.pyx":247 */
    __pyx_v_num_contacts = (__pyx_v_num_contacts + 1);

    /* "/home/jiba/src/soya/ode/terrain.pyx":249 */
    __pyx_4 = (__pyx_v_num_contacts == __pyx_v_max_contacts);
    if (__pyx_4) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":250 */
      __pyx_r = __pyx_v_num_contacts;
      goto __pyx_L0;
      goto __pyx_L10;
    }
    __pyx_L10:;
    __pyx_L5:;
  }
  __pyx_L6:;

  /* "/home/jiba/src/soya/ode/terrain.pyx":253 */
  vector_cross_product(__pyx_v_plane,__pyx_v_BD,__pyx_v_CD);

  /* "/home/jiba/src/soya/ode/terrain.pyx":254 */
  vector_normalize(__pyx_v_plane);

  /* "/home/jiba/src/soya/ode/terrain.pyx":255 */
  (__pyx_v_plane[3]) = ((((__pyx_v_plane[0]) * (__pyx_v_D[0])) + ((__pyx_v_plane[1]) * (__pyx_v_D[1]))) + ((__pyx_v_plane[2]) * (__pyx_v_D[2])));

  /* "/home/jiba/src/soya/ode/terrain.pyx":256 */
  dGeomPlaneSetParams(__pyx_v_4_ode__terrain_plane,(__pyx_v_plane[0]),(__pyx_v_plane[1]),(__pyx_v_plane[2]),(__pyx_v_plane[3]));

  /* "/home/jiba/src/soya/ode/terrain.pyx":258 */
  __pyx_v_numPlaneContacts = dCollide(__pyx_v_o2,__pyx_v_4_ode__terrain_plane,__pyx_v_flags,__pyx_v_planeContact,(sizeof(dContactGeom )));

  /* "/home/jiba/src/soya/ode/terrain.pyx":262 */
  for (__pyx_2 = 0; __pyx_2 < __pyx_v_numPlaneContacts; ++__pyx_2) {
    __pyx_3 = PyInt_FromLong(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 262; goto __pyx_L1;}
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_3;
    __pyx_3 = 0;

    /* "/home/jiba/src/soya/ode/terrain.pyx":268 */
    __pyx_1 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 268; goto __pyx_L1;}
    __pyx_5 = (((__pyx_v_planeContact[__pyx_1]).pos[0]) < (__pyx_v_A[0]));
    if (!__pyx_5) {
      __pyx_4 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 268; goto __pyx_L1;}
      __pyx_5 = (((__pyx_v_planeContact[__pyx_4]).pos[0]) > (__pyx_v_D[0]));
    }
    if (__pyx_5) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":269 */
      goto __pyx_L11;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "/home/jiba/src/soya/ode/terrain.pyx":271 */
    __pyx_4 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 271; goto __pyx_L1;}
    __pyx_1 = (((__pyx_v_planeContact[__pyx_4]).pos[2]) < (__pyx_v_A[2]));
    if (!__pyx_1) {
      __pyx_5 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 271; goto __pyx_L1;}
      __pyx_1 = (((__pyx_v_planeContact[__pyx_5]).pos[2]) > (__pyx_v_D[2]));
    }
    if (__pyx_1) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":272 */
      goto __pyx_L11;
      goto __pyx_L14;
    }
    __pyx_L14:;

    /* "/home/jiba/src/soya/ode/terrain.pyx":276 */
    __pyx_4 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 276; goto __pyx_L1;}
    __pyx_5 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 276; goto __pyx_L1;}
    __pyx_1 = ((((((__pyx_v_planeContact[__pyx_4]).pos[0]) - (__pyx_v_A[0])) + ((__pyx_v_planeContact[__pyx_5]).pos[2])) - (__pyx_v_A[2])) < ((__pyx_v_D[0]) - (__pyx_v_A[0])));
    if (__pyx_1) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":277 */
      goto __pyx_L11;
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "/home/jiba/src/soya/ode/terrain.pyx":280 */
    __pyx_v_pContact = ((dContactGeom (*))(((char (*))__pyx_v_contact) + (__pyx_v_num_contacts * __pyx_v_skip)));

    /* "/home/jiba/src/soya/ode/terrain.pyx":282 */
    __pyx_4 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 282; goto __pyx_L1;}
    (__pyx_v_pContact->pos[0]) = ((__pyx_v_planeContact[__pyx_4]).pos[0]);

    /* "/home/jiba/src/soya/ode/terrain.pyx":283 */
    __pyx_5 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 283; goto __pyx_L1;}
    (__pyx_v_pContact->pos[1]) = ((__pyx_v_planeContact[__pyx_5]).pos[1]);

    /* "/home/jiba/src/soya/ode/terrain.pyx":284 */
    __pyx_1 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 284; goto __pyx_L1;}
    (__pyx_v_pContact->pos[2]) = ((__pyx_v_planeContact[__pyx_1]).pos[2]);

    /* "/home/jiba/src/soya/ode/terrain.pyx":285 */
    __pyx_4 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 285; goto __pyx_L1;}
    (__pyx_v_pContact->normal[0]) = (-((__pyx_v_planeContact[__pyx_4]).normal[0]));

    /* "/home/jiba/src/soya/ode/terrain.pyx":286 */
    __pyx_5 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 286; goto __pyx_L1;}
    (__pyx_v_pContact->normal[1]) = (-((__pyx_v_planeContact[__pyx_5]).normal[1]));

    /* "/home/jiba/src/soya/ode/terrain.pyx":287 */
    __pyx_1 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 287; goto __pyx_L1;}
    (__pyx_v_pContact->normal[2]) = (-((__pyx_v_planeContact[__pyx_1]).normal[2]));

    /* "/home/jiba/src/soya/ode/terrain.pyx":288 */
    __pyx_4 = PyInt_AsLong(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 288; goto __pyx_L1;}
    __pyx_v_pContact->depth = (__pyx_v_planeContact[__pyx_4]).depth;

    /* "/home/jiba/src/soya/ode/terrain.pyx":289 */
    __pyx_v_pContact->g1 = __pyx_v_o1;

    /* "/home/jiba/src/soya/ode/terrain.pyx":290 */
    __pyx_v_pContact->g2 = __pyx_v_o2;

    /* "/home/jiba/src/soya/ode/terrain.pyx":294 */
    __pyx_v_num_contacts = (__pyx_v_num_contacts + 1);

    /* "/home/jiba/src/soya/ode/terrain.pyx":296 */
    __pyx_5 = (__pyx_v_num_contacts == __pyx_v_max_contacts);
    if (__pyx_5) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":297 */
      __pyx_r = __pyx_v_num_contacts;
      goto __pyx_L0;
      goto __pyx_L16;
    }
    __pyx_L16:;
    __pyx_L11:;
  }
  __pyx_L12:;

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

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  __Pyx_WriteUnraisable("_ode._Terrain._collide_cell");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_terrain);
  Py_DECREF(__pyx_v_i);
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_max;
static PyObject *__pyx_n_min;

static int __pyx_f_4_ode_8_Terrain__collide(struct __pyx_obj_4_ode__Terrain *__pyx_v_self,dGeomID __pyx_v_o1,dGeomID __pyx_v_o2,int __pyx_v_flags,dContactGeom (*__pyx_v_contact),int __pyx_v_skip) {
  int __pyx_v_num_contacts;
  int __pyx_v_max_contacts;
  int __pyx_v_x;
  int __pyx_v_z;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_k;
  GLfloat __pyx_v_min_x;
  GLfloat __pyx_v_max_x;
  GLfloat __pyx_v_min_z;
  GLfloat __pyx_v_max_z;
  dReal (__pyx_v_aabb[6]);
  dReal __pyx_v_depth;
  dContactGeom (*__pyx_v_pContact);
  dVector3 __pyx_v_lengths;
  __pyx_t_5_soya_TerrainVertex (*__pyx_v_vA);
  __pyx_t_5_soya_TerrainVertex (*__pyx_v_vB);
  __pyx_t_5_soya_TerrainVertex (*__pyx_v_vC);
  __pyx_t_5_soya_TerrainVertex (*__pyx_v_vD);
  GLfloat (__pyx_v_m[19]);
  GLfloat __pyx_v_BC;
  GLfloat __pyx_v_BD;
  GLfloat __pyx_v_CD;
  GLfloat (__pyx_v_plane[4]);
  struct __pyx_obj_5_soya__Terrain *__pyx_v_terrain;
  GLfloat (__pyx_v_P[3]);
  int __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;
  PyObject *__pyx_8 = 0;
  PyObject *__pyx_9 = 0;
  PyObject *__pyx_10 = 0;
  PyObject *__pyx_11 = 0;
  int __pyx_12;
  int __pyx_13;
  float __pyx_14;
  float __pyx_15;
  float __pyx_16;
  Py_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_terrain = Py_None; Py_INCREF((PyObject *) __pyx_v_terrain);

  /* "/home/jiba/src/soya/ode/terrain.pyx":317 */
  Py_INCREF(((PyObject *)__pyx_v_self->_terrain));
  Py_DECREF((PyObject *)((PyObject *)__pyx_v_terrain));
  __pyx_v_terrain = ((PyObject *)__pyx_v_self->_terrain);

  /* "/home/jiba/src/soya/ode/terrain.pyx":320 */
  __pyx_1 = (__pyx_v_flags & 65535);
  if (!__pyx_1) {
    __pyx_1 = 1;
  }
  __pyx_v_max_contacts = __pyx_1;

  /* "/home/jiba/src/soya/ode/terrain.pyx":323 */
  __pyx_v_flags = ((__pyx_v_flags & 4294901760) | 10);

  /* "/home/jiba/src/soya/ode/terrain.pyx":328 */
  dGeomGetAABB(__pyx_v_o2,__pyx_v_aabb);

  /* "/home/jiba/src/soya/ode/terrain.pyx":335 */
  multiply_matrix(__pyx_v_m,((struct __pyx_vtabstruct_4_ode__World *)__pyx_v_self->__pyx_base.world->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base._root_matrix(((struct __pyx_obj_5_soya_CoordSyst *)__pyx_v_self->__pyx_base.world)),((struct __pyx_vtabstruct_5_soya__Terrain *)__pyx_v_terrain->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base._inverted_root_matrix(((struct __pyx_obj_5_soya_CoordSyst *)__pyx_v_terrain)));

  /* "/home/jiba/src/soya/ode/terrain.pyx":337 */
  (__pyx_v_P[0]) = (__pyx_v_aabb[0]);

  /* "/home/jiba/src/soya/ode/terrain.pyx":338 */
  (__pyx_v_P[1]) = (__pyx_v_aabb[2]);

  /* "/home/jiba/src/soya/ode/terrain.pyx":339 */
  (__pyx_v_P[2]) = (__pyx_v_aabb[4]);

  /* "/home/jiba/src/soya/ode/terrain.pyx":341 */
  point_by_matrix(__pyx_v_P,__pyx_v_m);

  /* "/home/jiba/src/soya/ode/terrain.pyx":344 */
  __pyx_v_min_x = (__pyx_v_P[0]);

  /* "/home/jiba/src/soya/ode/terrain.pyx":345 */
  __pyx_v_max_x = (__pyx_v_P[0]);

  /* "/home/jiba/src/soya/ode/terrain.pyx":346 */
  __pyx_v_min_z = (__pyx_v_P[2]);

  /* "/home/jiba/src/soya/ode/terrain.pyx":347 */
  __pyx_v_max_z = (__pyx_v_P[2]);

  /* "/home/jiba/src/soya/ode/terrain.pyx":350 */
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(2); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_4 = PyInt_FromLong(4); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; 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 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(3); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_4 = PyInt_FromLong(4); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; 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 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(3); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_4 = PyInt_FromLong(4); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; 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 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(2); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_4 = PyInt_FromLong(5); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_8 = PyTuple_New(3); if (!__pyx_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; 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_4);
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_4 = 0;
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(2); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_4 = PyInt_FromLong(5); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_9 = PyTuple_New(3); if (!__pyx_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_9, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_9, 1, __pyx_3);
  PyTuple_SET_ITEM(__pyx_9, 2, __pyx_4);
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_4 = 0;
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(3); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_4 = PyInt_FromLong(5); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_10 = PyTuple_New(3); if (!__pyx_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_10, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_10, 1, __pyx_3);
  PyTuple_SET_ITEM(__pyx_10, 2, __pyx_4);
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_4 = 0;
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(3); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_4 = PyInt_FromLong(5); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_11 = PyTuple_New(3); if (!__pyx_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_11, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_11, 1, __pyx_3);
  PyTuple_SET_ITEM(__pyx_11, 2, __pyx_4);
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_4 = 0;
  __pyx_2 = PyTuple_New(7); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; 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);
  PyTuple_SET_ITEM(__pyx_2, 3, __pyx_8);
  PyTuple_SET_ITEM(__pyx_2, 4, __pyx_9);
  PyTuple_SET_ITEM(__pyx_2, 5, __pyx_10);
  PyTuple_SET_ITEM(__pyx_2, 6, __pyx_11);
  __pyx_5 = 0;
  __pyx_6 = 0;
  __pyx_7 = 0;
  __pyx_8 = 0;
  __pyx_9 = 0;
  __pyx_10 = 0;
  __pyx_11 = 0;
  __pyx_3 = PyObject_GetIter(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  for (;;) {
    __pyx_L2:;
    __pyx_4 = PyIter_Next(__pyx_3);
    if (!__pyx_4) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
      break;
    }
    __pyx_5 = __Pyx_UnpackItem(__pyx_4, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
    __pyx_1 = PyInt_AsLong(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    __pyx_v_i = __pyx_1;
    __pyx_6 = __Pyx_UnpackItem(__pyx_4, 1); if (!__pyx_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
    __pyx_12 = PyInt_AsLong(__pyx_6); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_v_j = __pyx_12;
    __pyx_7 = __Pyx_UnpackItem(__pyx_4, 2); if (!__pyx_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
    __pyx_13 = PyInt_AsLong(__pyx_7); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_v_k = __pyx_13;
    if (__Pyx_EndUnpack(__pyx_4, 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/jiba/src/soya/ode/terrain.pyx":351 */
    (__pyx_v_P[0]) = (__pyx_v_aabb[__pyx_v_i]);

    /* "/home/jiba/src/soya/ode/terrain.pyx":352 */
    (__pyx_v_P[1]) = (__pyx_v_aabb[__pyx_v_j]);

    /* "/home/jiba/src/soya/ode/terrain.pyx":353 */
    (__pyx_v_P[2]) = (__pyx_v_aabb[__pyx_v_k]);

    /* "/home/jiba/src/soya/ode/terrain.pyx":355 */
    point_by_matrix(__pyx_v_P,__pyx_v_m);

    /* "/home/jiba/src/soya/ode/terrain.pyx":357 */
    __pyx_1 = ((__pyx_v_P[0]) < __pyx_v_min_x);
    if (__pyx_1) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":358 */
      __pyx_v_min_x = (__pyx_v_P[0]);
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/jiba/src/soya/ode/terrain.pyx":359 */
    __pyx_12 = ((__pyx_v_P[0]) > __pyx_v_max_x);
    if (__pyx_12) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":360 */
      __pyx_v_max_x = (__pyx_v_P[0]);
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/jiba/src/soya/ode/terrain.pyx":361 */
    __pyx_13 = ((__pyx_v_P[2]) < __pyx_v_min_z);
    if (__pyx_13) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":362 */
      __pyx_v_min_z = (__pyx_v_P[2]);
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/jiba/src/soya/ode/terrain.pyx":363 */
    __pyx_1 = ((__pyx_v_P[2]) > __pyx_v_max_z);
    if (__pyx_1) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":364 */
      __pyx_v_max_z = (__pyx_v_P[2]);
      goto __pyx_L7;
    }
    __pyx_L7:;
  }
  __pyx_L3:;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/jiba/src/soya/ode/terrain.pyx":366 */
  __pyx_v_num_contacts = 0;

  /* "/home/jiba/src/soya/ode/terrain.pyx":368 */
  __pyx_8 = __Pyx_GetName(__pyx_b, __pyx_n_max); if (!__pyx_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; goto __pyx_L1;}
  __pyx_9 = PyInt_FromLong(0); if (!__pyx_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; goto __pyx_L1;}
  __pyx_10 = PyFloat_FromDouble(__pyx_v_min_z); if (!__pyx_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; goto __pyx_L1;}
  __pyx_11 = PyTuple_New(2); if (!__pyx_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_11, 0, __pyx_9);
  PyTuple_SET_ITEM(__pyx_11, 1, __pyx_10);
  __pyx_9 = 0;
  __pyx_10 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_8, __pyx_11); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; goto __pyx_L1;}
  Py_DECREF(__pyx_8); __pyx_8 = 0;
  Py_DECREF(__pyx_11); __pyx_11 = 0;
  __pyx_14 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_min); if (!__pyx_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; goto __pyx_L1;}
  __pyx_6 = PyInt_FromLong(__pyx_v_terrain->_nb_vertex_depth); if (!__pyx_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; goto __pyx_L1;}
  __pyx_7 = PyFloat_FromDouble(__pyx_v_max_z); if (!__pyx_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_6);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_7);
  __pyx_6 = 0;
  __pyx_7 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_15 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_12 = ((int )ceil(__pyx_15));
  for (__pyx_v_z = ((int )floor(__pyx_14)); __pyx_v_z < __pyx_12; ++__pyx_v_z) {

    /* "/home/jiba/src/soya/ode/terrain.pyx":369 */
    __pyx_9 = __Pyx_GetName(__pyx_b, __pyx_n_max); if (!__pyx_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; goto __pyx_L1;}
    __pyx_10 = PyInt_FromLong(0); if (!__pyx_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; goto __pyx_L1;}
    __pyx_8 = PyFloat_FromDouble(__pyx_v_min_x); if (!__pyx_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; goto __pyx_L1;}
    __pyx_11 = PyTuple_New(2); if (!__pyx_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_11, 0, __pyx_10);
    PyTuple_SET_ITEM(__pyx_11, 1, __pyx_8);
    __pyx_10 = 0;
    __pyx_8 = 0;
    __pyx_2 = PyObject_CallObject(__pyx_9, __pyx_11); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; goto __pyx_L1;}
    Py_DECREF(__pyx_9); __pyx_9 = 0;
    Py_DECREF(__pyx_11); __pyx_11 = 0;
    __pyx_15 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_min); if (!__pyx_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_terrain->_nb_vertex_width); if (!__pyx_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; goto __pyx_L1;}
    __pyx_5 = PyFloat_FromDouble(__pyx_v_max_x); if (!__pyx_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_7);
    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_5);
    __pyx_7 = 0;
    __pyx_5 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_6, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __pyx_16 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_13 = ((int )ceil(__pyx_16));
    for (__pyx_v_x = ((int )floor(__pyx_15)); __pyx_v_x < __pyx_13; ++__pyx_v_x) {

      /* "/home/jiba/src/soya/ode/terrain.pyx":370 */
      __pyx_v_num_contacts = (__pyx_v_num_contacts + ((struct __pyx_vtabstruct_4_ode__Terrain *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_collide_cell(__pyx_v_self,__pyx_v_x,__pyx_v_z,__pyx_v_o1,__pyx_v_o2,(__pyx_v_max_contacts - __pyx_v_num_contacts),__pyx_v_flags,((dContactGeom (*))(((char (*))__pyx_v_contact) + (__pyx_v_num_contacts * __pyx_v_skip))),__pyx_v_skip));
      __pyx_L10:;
    }
    __pyx_L11:;
    __pyx_L8:;
  }
  __pyx_L9:;

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

  __pyx_r = 0;
  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);
  Py_XDECREF(__pyx_8);
  Py_XDECREF(__pyx_9);
  Py_XDECREF(__pyx_10);
  Py_XDECREF(__pyx_11);
  __Pyx_WriteUnraisable("_ode._Terrain._collide");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_terrain);
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_8_Terrain___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_8_Terrain___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5_soya__Terrain *__pyx_v_terrain = 0;
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"terrain","space",0};
  __pyx_v_space = __pyx_k74;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_terrain, &__pyx_v_space)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_terrain);
  Py_INCREF((PyObject *)__pyx_v_space);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_terrain), __pyx_ptype_5_soya__Terrain, 1, "terrain")) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 377; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 377; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/terrain.pyx":378 */
  Py_INCREF(((PyObject *)__pyx_v_terrain));
  Py_DECREF((PyObject *)((PyObject *)((struct __pyx_obj_4_ode__Terrain *)__pyx_v_self)->_terrain));
  ((struct __pyx_obj_4_ode__Terrain *)__pyx_v_self)->_terrain = ((PyObject *)__pyx_v_terrain);

  /* "/home/jiba/src/soya/ode/terrain.pyx":379 */
  ((struct __pyx_obj_4_ode__Terrain *)__pyx_v_self)->__pyx_base.gid = dCreateGeom(__pyx_v_4_ode_dTerrainClass);

  /* "/home/jiba/src/soya/ode/terrain.pyx":381 */
  __pyx_1 = ((PyObject *)__pyx_v_space) != Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/terrain.pyx":382 */
    dSpaceAdd(__pyx_v_space->sid,((struct __pyx_obj_4_ode__Terrain *)__pyx_v_self)->__pyx_base.gid);
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._Terrain.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_terrain);
  Py_DECREF((PyObject *)__pyx_v_space);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

static int __pyx_f_4_ode_8_Terrain___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_8_Terrain___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5_soya__Terrain *__pyx_v_terrain = 0;
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"terrain","space",0};
  __pyx_v_space = __pyx_k75;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_terrain, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_terrain);
  Py_INCREF((PyObject *)__pyx_v_space);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_terrain), __pyx_ptype_5_soya__Terrain, 1, "terrain")) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 384; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 384; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/terrain.pyx":385 */
  __pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4_ode_GeomObject), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 385; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 385; goto __pyx_L1;}
  Py_INCREF((PyObject *)__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
  Py_INCREF((PyObject *)((PyObject *)__pyx_v_terrain->__pyx_base.__pyx_base._parent));
  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_terrain->__pyx_base.__pyx_base._parent));
  Py_INCREF((PyObject *)((PyObject *)__pyx_v_space));
  PyTuple_SET_ITEM(__pyx_2, 2, ((PyObject *)__pyx_v_space));
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 385; 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 = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("_ode._Terrain.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_terrain);
  Py_DECREF((PyObject *)__pyx_v_space);
  return __pyx_r;
}


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

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

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

static PyObject *__pyx_f_4_ode_8_Terrain_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4_ode_8_Terrain_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/terrain.pyx":391 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 391; 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._Terrain.placeable");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_8_Terrain_4body___get__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_4_ode_8_Terrain_4body___get__[] = "Terrain can\'t have a body, so return environment";
static PyObject *__pyx_f_4_ode_8_Terrain_4body___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/terrain.pyx":396 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_environment); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 396; 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._Terrain.body.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static void __pyx_f_4_ode_TerrainGetAABB(dGeomID __pyx_v_geom,dReal (*__pyx_v_aabb)) {
  struct __pyx_obj_4_ode__Terrain *__pyx_v_terrain;
  PyObject *__pyx_1 = 0;
  __pyx_v_terrain = Py_None; Py_INCREF((PyObject *) __pyx_v_terrain);

  /* "/home/jiba/src/soya/ode/terrain.pyx":407 */
  __pyx_1 = (PyObject *)dGeomGetData(__pyx_v_geom);
  Py_INCREF((PyObject *)__pyx_1);
  Py_DECREF((PyObject *)((PyObject *)__pyx_v_terrain));
  __pyx_v_terrain = __pyx_1;
  __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/terrain.pyx":408 */
  ((struct __pyx_vtabstruct_4_ode__Terrain *)__pyx_v_terrain->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_get_aabb(__pyx_v_terrain,__pyx_v_aabb);

  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_WriteUnraisable("_ode.TerrainGetAABB");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_terrain);
}

static int __pyx_f_4_ode_TerrainCollide(dGeomID __pyx_v_o1,dGeomID __pyx_v_o2,int __pyx_v_flags,dContactGeom (*__pyx_v_contact),int __pyx_v_skip) {
  struct __pyx_obj_4_ode__Terrain *__pyx_v_terrain;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  __pyx_v_terrain = Py_None; Py_INCREF((PyObject *) __pyx_v_terrain);

  /* "/home/jiba/src/soya/ode/terrain.pyx":413 */
  __pyx_1 = (PyObject *)dGeomGetData(__pyx_v_o1);
  Py_INCREF((PyObject *)__pyx_1);
  Py_DECREF((PyObject *)((PyObject *)__pyx_v_terrain));
  __pyx_v_terrain = __pyx_1;
  __pyx_1 = 0;

  /* "/home/jiba/src/soya/ode/terrain.pyx":414 */
  __pyx_r = ((struct __pyx_vtabstruct_4_ode__Terrain *)__pyx_v_terrain->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_collide(__pyx_v_terrain,__pyx_v_o1,__pyx_v_o2,__pyx_v_flags,__pyx_v_contact,__pyx_v_skip);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_WriteUnraisable("_ode.TerrainCollide");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_terrain);
  return __pyx_r;
}

static dColliderFn (*__pyx_f_4_ode_TerrainGetColliderFn(int __pyx_v_gclass)) {
  dColliderFn (*__pyx_r);
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  int __pyx_6;

  /* "/home/jiba/src/soya/ode/terrain.pyx":419 */
  __pyx_1 = PyInt_FromLong(__pyx_v_gclass); if (!__pyx_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 419; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(dSphereClass); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 419; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(dBoxClass); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 419; goto __pyx_L1;}
  __pyx_4 = PyInt_FromLong(dCCylinderClass); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 419; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 419; 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_6 = PySequence_Contains(__pyx_5, __pyx_1); if (__pyx_6 < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 419; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_6) {

    /* "/home/jiba/src/soya/ode/terrain.pyx":420 */
    __pyx_r = __pyx_f_4_ode_TerrainCollide;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

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

  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_WriteUnraisable("_ode.TerrainGetColliderFn");
  __pyx_L0:;
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/terrain.pyx":426 */

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode.TerrainAABBTest");
  __pyx_L0:;
  return __pyx_r;
}

static int __pyx_f_4_ode_8_TriMesh___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_8_TriMesh___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_parent = 0;
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_r;
  static char *__pyx_argnames[] = {"parent","space",0};
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_parent, &__pyx_v_space)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF(__pyx_v_parent);
  Py_INCREF(__pyx_v_space);

  /* "/home/jiba/src/soya/ode/model.pyx":33 */
  ((struct __pyx_obj_4_ode__TriMesh *)__pyx_v_self)->_data = dGeomTriMeshDataCreate();

  /* "/home/jiba/src/soya/ode/model.pyx":35 */
  ((struct __pyx_obj_4_ode__TriMesh *)__pyx_v_self)->_colliding = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._TriMesh.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF(__pyx_v_parent);
  Py_DECREF(__pyx_v_space);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/model.pyx":38 */
  dGeomTriMeshDataDestroy(((struct __pyx_obj_4_ode__TriMesh *)__pyx_v_self)->_data);

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

static PyObject *__pyx_k115p;

static char (__pyx_k115[]) = "setting last transformation";

static void __pyx_f_4_ode_8_TriMesh__set_last_transformation(struct __pyx_obj_4_ode__TriMesh *__pyx_v_self) {
  double (*__pyx_v_t);
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_1;
  Py_INCREF((PyObject *)__pyx_v_self);

  /* "/home/jiba/src/soya/ode/model.pyx":46 */
  __pyx_v_t = __pyx_v_self->_last_transformation;

  /* "/home/jiba/src/soya/ode/model.pyx":49 */
  __pyx_1 = (__pyx_v_self->_colliding == 0);
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/model.pyx":50 */
    if (__Pyx_PrintItem(__pyx_k115p) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 50; goto __pyx_L1;}
    if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 50; goto __pyx_L1;}

    /* "/home/jiba/src/soya/ode/model.pyx":54 */
    for (__pyx_v_i = 0; __pyx_v_i < 16; ++__pyx_v_i) {

      /* "/home/jiba/src/soya/ode/model.pyx":55 */
      (__pyx_v_t[__pyx_v_i]) = ((double )(__pyx_v_self->__pyx_base.__pyx_base._matrix[__pyx_v_i]));
      __pyx_L3:;
    }
    __pyx_L4:;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/model.pyx":73 */
    __pyx_v_self->_colliding = 0;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/model.pyx":77 */
  dGeomTriMeshDataSet(__pyx_v_self->_data,TRIMESH_LAST_TRANSFORMATION,((void (*))__pyx_v_t));

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("_ode._TriMesh._set_last_transformation");
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
}

static int __pyx_f_4_ode_10_GeomModel___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_10_GeomModel___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5_soya__World *__pyx_v_parent = 0;
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  struct __pyx_obj_5_soya__SimpleModel *__pyx_v_model = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  __pyx_t_5_soya_ModelFace __pyx_v_face;
  float (*__pyx_v_normals);
  int (*__pyx_v_indices);
  int __pyx_v_i;
  int __pyx_v_nb_tris;
  dSpaceID __pyx_v_sid;
  int __pyx_r;
  int __pyx_1;
  int __pyx_2;
  static char *__pyx_argnames[] = {"parent","space","model",0};
  __pyx_v_model = __pyx_k76;
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_parent, &__pyx_v_space, &__pyx_v_model)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_parent);
  Py_INCREF((PyObject *)__pyx_v_space);
  Py_INCREF((PyObject *)__pyx_v_model);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_5_soya__World, 1, "parent")) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 95; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 95; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_model), __pyx_ptype_5_soya__SimpleModel, 1, "model")) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 95; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/model.pyx":102 */
  __pyx_1 = ((PyObject *)__pyx_v_model) == Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/model.pyx":103 */
    if (!__Pyx_TypeTest(((PyObject *)__pyx_v_parent->__pyx_base._model), __pyx_ptype_5_soya__SimpleModel)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 103; goto __pyx_L1;}
    Py_INCREF(((PyObject *)__pyx_v_parent->__pyx_base._model));
    Py_DECREF((PyObject *)((PyObject *)__pyx_v_model));
    __pyx_v_model = ((PyObject *)__pyx_v_parent->__pyx_base._model);
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/model.pyx":105 */
  Py_INCREF(((PyObject *)__pyx_v_model));
  Py_DECREF((PyObject *)((PyObject *)((struct __pyx_obj_4_ode__GeomModel *)__pyx_v_self)->model));
  ((struct __pyx_obj_4_ode__GeomModel *)__pyx_v_self)->model = ((PyObject *)__pyx_v_model);

  /* "/home/jiba/src/soya/ode/model.pyx":107 */
  __pyx_v_nb_tris = __pyx_v_model->_nb_faces;

  /* "/home/jiba/src/soya/ode/model.pyx":109 */
  __pyx_1 = __pyx_v_model->_nb_faces;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_1; ++__pyx_v_i) {

    /* "/home/jiba/src/soya/ode/model.pyx":110 */
    __pyx_2 = ((__pyx_v_model->_faces[__pyx_v_i]).option & __pyx_e_5_soya_FACE_QUAD);
    if (__pyx_2) {

      /* "/home/jiba/src/soya/ode/model.pyx":111 */
      __pyx_v_nb_tris = (__pyx_v_nb_tris + 1);
      goto __pyx_L5;
    }
    __pyx_L5:;
    __pyx_L3:;
  }
  __pyx_L4:;

  /* "/home/jiba/src/soya/ode/model.pyx":114 */
  ((struct __pyx_obj_4_ode__GeomModel *)__pyx_v_self)->_normals = ((float (*))malloc(((__pyx_v_nb_tris * (sizeof(dReal ))) * 3)));

  /* "/home/jiba/src/soya/ode/model.pyx":115 */
  ((struct __pyx_obj_4_ode__GeomModel *)__pyx_v_self)->_indices = ((int (*))malloc(((__pyx_v_nb_tris * (sizeof(int ))) * 3)));

  /* "/home/jiba/src/soya/ode/model.pyx":117 */
  __pyx_2 = ((PyObject *)__pyx_v_space) == Py_None;
  if (__pyx_2) {

    /* "/home/jiba/src/soya/ode/model.pyx":118 */
    __pyx_v_sid = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/model.pyx":120 */
    __pyx_v_sid = __pyx_v_space->sid;
  }
  __pyx_L6:;

  /* "/home/jiba/src/soya/ode/model.pyx":122 */
  __pyx_v_normals = ((struct __pyx_obj_4_ode__GeomModel *)__pyx_v_self)->_normals;

  /* "/home/jiba/src/soya/ode/model.pyx":123 */
  __pyx_v_indices = ((struct __pyx_obj_4_ode__GeomModel *)__pyx_v_self)->_indices;

  /* "/home/jiba/src/soya/ode/model.pyx":128 */
  __pyx_1 = __pyx_v_model->_nb_faces;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_1; ++__pyx_v_i) {

    /* "/home/jiba/src/soya/ode/model.pyx":129 */
    __pyx_v_face = (__pyx_v_model->_faces[__pyx_v_i]);

    /* "/home/jiba/src/soya/ode/model.pyx":131 */
    memcpy(__pyx_v_normals,(__pyx_v_model->_values + __pyx_v_face.normal),(3 * (sizeof(dReal ))));

    /* "/home/jiba/src/soya/ode/model.pyx":132 */
    __pyx_v_normals = (__pyx_v_normals + 3);

    /* "/home/jiba/src/soya/ode/model.pyx":134 */
    (__pyx_v_indices[0]) = ((__pyx_v_model->_vertex_coords[(__pyx_v_face.v[0])]) / 3);

    /* "/home/jiba/src/soya/ode/model.pyx":135 */
    (__pyx_v_indices[1]) = ((__pyx_v_model->_vertex_coords[(__pyx_v_face.v[1])]) / 3);

    /* "/home/jiba/src/soya/ode/model.pyx":136 */
    (__pyx_v_indices[2]) = ((__pyx_v_model->_vertex_coords[(__pyx_v_face.v[2])]) / 3);

    /* "/home/jiba/src/soya/ode/model.pyx":137 */
    __pyx_v_indices = (__pyx_v_indices + 3);

    /* "/home/jiba/src/soya/ode/model.pyx":139 */
    __pyx_2 = (__pyx_v_face.option & __pyx_e_5_soya_FACE_QUAD);
    if (__pyx_2) {

      /* "/home/jiba/src/soya/ode/model.pyx":141 */
      memcpy(__pyx_v_normals,(__pyx_v_model->_values + __pyx_v_face.normal),(3 * (sizeof(dReal ))));

      /* "/home/jiba/src/soya/ode/model.pyx":142 */
      __pyx_v_normals = (__pyx_v_normals + 3);

      /* "/home/jiba/src/soya/ode/model.pyx":144 */
      (__pyx_v_indices[0]) = ((__pyx_v_model->_vertex_coords[(__pyx_v_face.v[1])]) / 3);

      /* "/home/jiba/src/soya/ode/model.pyx":145 */
      (__pyx_v_indices[1]) = ((__pyx_v_model->_vertex_coords[(__pyx_v_face.v[2])]) / 3);

      /* "/home/jiba/src/soya/ode/model.pyx":146 */
      (__pyx_v_indices[2]) = ((__pyx_v_model->_vertex_coords[(__pyx_v_face.v[3])]) / 3);

      /* "/home/jiba/src/soya/ode/model.pyx":147 */
      __pyx_v_indices = (__pyx_v_indices + 3);
      goto __pyx_L9;
    }
    __pyx_L9:;
    __pyx_L7:;
  }
  __pyx_L8:;

  /* "/home/jiba/src/soya/ode/model.pyx":151 */
  dGeomTriMeshDataBuildSingle1(((struct __pyx_obj_4_ode__GeomModel *)__pyx_v_self)->__pyx_base._data,__pyx_v_model->_coords,(3 * (sizeof(dReal ))),__pyx_v_model->_nb_coords,((struct __pyx_obj_4_ode__GeomModel *)__pyx_v_self)->_indices,(__pyx_v_nb_tris * 3),(3 * (sizeof(int ))),((void (*))((struct __pyx_obj_4_ode__GeomModel *)__pyx_v_self)->_normals));

  /* "/home/jiba/src/soya/ode/model.pyx":153 */
  ((struct __pyx_obj_4_ode__GeomModel *)__pyx_v_self)->__pyx_base.__pyx_base.gid = dCreateTriMesh(__pyx_v_sid,((struct __pyx_obj_4_ode__GeomModel *)__pyx_v_self)->__pyx_base._data,0,0,0);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_ode._GeomModel.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_parent);
  Py_DECREF((PyObject *)__pyx_v_space);
  Py_DECREF((PyObject *)__pyx_v_model);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/model.pyx":156 */
  free(((struct __pyx_obj_4_ode__GeomModel *)__pyx_v_self)->_normals);

  /* "/home/jiba/src/soya/ode/model.pyx":157 */
  free(((struct __pyx_obj_4_ode__GeomModel *)__pyx_v_self)->_indices);

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

static PyObject *__pyx_f_4_ode_10_GeomModel_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4_ode_10_GeomModel_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/model.pyx":160 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 160; 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._GeomModel.placeable");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static int __pyx_f_4_ode_12_GeomTerrain___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_12_GeomTerrain___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5_soya__Terrain *__pyx_v_terrain = 0;
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  float (*__pyx_v_normals);
  int (*__pyx_v_indices);
  int __pyx_v_i;
  int __pyx_v_nvertices;
  int __pyx_v_ntris;
  int __pyx_v_v1;
  int __pyx_v_v2;
  int __pyx_v_v3;
  int __pyx_v_v4;
  dSpaceID __pyx_v_sid;
  PyObject *__pyx_v_j;
  int __pyx_r;
  int __pyx_1;
  long __pyx_2;
  long __pyx_3;
  PyObject *__pyx_4 = 0;
  long __pyx_5;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  PyObject *__pyx_8 = 0;
  int __pyx_9;
  static char *__pyx_argnames[] = {"terrain","space",0};
  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, &__pyx_v_kw) < 0) return -1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_terrain, &__pyx_v_space)) {
    Py_XDECREF(__pyx_args);
    Py_XDECREF(__pyx_kwds);
    Py_XDECREF(__pyx_v_args);
    Py_XDECREF(__pyx_v_kw);
    return -1;
  }
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_terrain);
  Py_INCREF((PyObject *)__pyx_v_space);
  __pyx_v_j = Py_None; Py_INCREF(__pyx_v_j);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_terrain), __pyx_ptype_5_soya__Terrain, 1, "terrain")) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 171; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 171; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/model.pyx":177 */
  __pyx_1 = ((PyObject *)__pyx_v_space) == Py_None;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/ode/model.pyx":178 */
    __pyx_v_sid = 0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/jiba/src/soya/ode/model.pyx":180 */
    __pyx_v_sid = __pyx_v_space->sid;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/ode/model.pyx":182 */
  Py_INCREF(((PyObject *)__pyx_v_terrain));
  Py_DECREF((PyObject *)((PyObject *)((struct __pyx_obj_4_ode__GeomTerrain *)__pyx_v_self)->terrain));
  ((struct __pyx_obj_4_ode__GeomTerrain *)__pyx_v_self)->terrain = ((PyObject *)__pyx_v_terrain);

  /* "/home/jiba/src/soya/ode/model.pyx":184 */
  __pyx_v_nvertices = (__pyx_v_terrain->_nb_vertex_width * __pyx_v_terrain->_nb_vertex_depth);

  /* "/home/jiba/src/soya/ode/model.pyx":185 */
  __pyx_v_ntris = (((__pyx_v_terrain->_nb_vertex_width - 1) * (__pyx_v_terrain->_nb_vertex_depth - 1)) * 2);

  /* "/home/jiba/src/soya/ode/model.pyx":189 */
  ((struct __pyx_obj_4_ode__GeomTerrain *)__pyx_v_self)->_indices = ((int (*))malloc(((__pyx_v_ntris * (sizeof(int ))) * 3)));

  /* "/home/jiba/src/soya/ode/model.pyx":191 */
  __pyx_v_indices = ((struct __pyx_obj_4_ode__GeomTerrain *)__pyx_v_self)->_indices;

  /* "/home/jiba/src/soya/ode/model.pyx":192 */
  __pyx_3 = (__pyx_v_terrain->_nb_vertex_depth - 1);
  for (__pyx_2 = 0; __pyx_2 < __pyx_3; ++__pyx_2) {
    __pyx_4 = PyInt_FromLong(__pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 192; goto __pyx_L1;}
    Py_DECREF(__pyx_v_j);
    __pyx_v_j = __pyx_4;
    __pyx_4 = 0;

    /* "/home/jiba/src/soya/ode/model.pyx":193 */
    __pyx_5 = (__pyx_v_terrain->_nb_vertex_width - 1);
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) {

      /* "/home/jiba/src/soya/ode/model.pyx":194 */
      __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 194; goto __pyx_L1;}
      __pyx_6 = PyInt_FromLong(__pyx_v_terrain->_nb_vertex_width); if (!__pyx_6) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 194; goto __pyx_L1;}
      __pyx_7 = PyNumber_Multiply(__pyx_v_j, __pyx_6); if (!__pyx_7) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 194; goto __pyx_L1;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      __pyx_6 = PyNumber_Add(__pyx_4, __pyx_7); if (!__pyx_6) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 194; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      __pyx_1 = PyInt_AsLong(__pyx_6); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 194; goto __pyx_L1;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      __pyx_v_v1 = __pyx_1;

      /* "/home/jiba/src/soya/ode/model.pyx":195 */
      __pyx_4 = PyInt_FromLong((__pyx_v_i + 1)); if (!__pyx_4) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 195; goto __pyx_L1;}
      __pyx_7 = PyInt_FromLong(__pyx_v_terrain->_nb_vertex_width); if (!__pyx_7) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 195; goto __pyx_L1;}
      __pyx_6 = PyNumber_Multiply(__pyx_v_j, __pyx_7); if (!__pyx_6) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 195; goto __pyx_L1;}
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      __pyx_7 = PyNumber_Add(__pyx_4, __pyx_6); if (!__pyx_7) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 195; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      __pyx_1 = PyInt_AsLong(__pyx_7); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 195; goto __pyx_L1;}
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      __pyx_v_v2 = __pyx_1;

      /* "/home/jiba/src/soya/ode/model.pyx":196 */
      __pyx_4 = PyInt_FromLong((__pyx_v_i + 1)); if (!__pyx_4) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 196; goto __pyx_L1;}
      __pyx_6 = PyInt_FromLong(1); if (!__pyx_6) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 196; goto __pyx_L1;}
      __pyx_7 = PyNumber_Add(__pyx_v_j, __pyx_6); if (!__pyx_7) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 196; goto __pyx_L1;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      __pyx_6 = PyInt_FromLong(__pyx_v_terrain->_nb_vertex_width); if (!__pyx_6) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 196; goto __pyx_L1;}
      __pyx_8 = PyNumber_Multiply(__pyx_7, __pyx_6); if (!__pyx_8) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 196; goto __pyx_L1;}
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      __pyx_7 = PyNumber_Add(__pyx_4, __pyx_8); if (!__pyx_7) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 196; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      Py_DECREF(__pyx_8); __pyx_8 = 0;
      __pyx_1 = PyInt_AsLong(__pyx_7); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 196; goto __pyx_L1;}
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      __pyx_v_v3 = __pyx_1;

      /* "/home/jiba/src/soya/ode/model.pyx":197 */
      __pyx_6 = PyInt_FromLong(__pyx_v_i); if (!__pyx_6) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 197; goto __pyx_L1;}
      __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 197; goto __pyx_L1;}
      __pyx_8 = PyNumber_Add(__pyx_v_j, __pyx_4); if (!__pyx_8) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 197; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __pyx_7 = PyInt_FromLong(__pyx_v_terrain->_nb_vertex_width); if (!__pyx_7) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 197; goto __pyx_L1;}
      __pyx_4 = PyNumber_Multiply(__pyx_8, __pyx_7); if (!__pyx_4) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 197; goto __pyx_L1;}
      Py_DECREF(__pyx_8); __pyx_8 = 0;
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      __pyx_8 = PyNumber_Add(__pyx_6, __pyx_4); if (!__pyx_8) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 197; goto __pyx_L1;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __pyx_1 = PyInt_AsLong(__pyx_8); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 197; goto __pyx_L1;}
      Py_DECREF(__pyx_8); __pyx_8 = 0;
      __pyx_v_v4 = __pyx_1;

      /* "/home/jiba/src/soya/ode/model.pyx":200 */
      __pyx_7 = PyInt_FromLong((__pyx_v_i & 1)); if (!__pyx_7) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 200; goto __pyx_L1;}
      __pyx_1 = PyObject_IsTrue(__pyx_7); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 200; goto __pyx_L1;}
      if (__pyx_1) {
        Py_DECREF(__pyx_7); __pyx_7 = 0;
        __pyx_6 = PyInt_FromLong(1); if (!__pyx_6) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 200; goto __pyx_L1;}
        __pyx_7 = PyNumber_And(__pyx_v_j, __pyx_6); if (!__pyx_7) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 200; goto __pyx_L1;}
        Py_DECREF(__pyx_6); __pyx_6 = 0;
      }
      __pyx_1 = PyObject_IsTrue(__pyx_7); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 200; goto __pyx_L1;}
      if (!__pyx_1) {
        Py_DECREF(__pyx_7); __pyx_7 = 0;
        __pyx_1 = (!(__pyx_v_i * 1));
        if (__pyx_1) {
          __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 200; goto __pyx_L1;}
          __pyx_8 = PyNumber_And(__pyx_v_j, __pyx_4); if (!__pyx_8) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 200; goto __pyx_L1;}
          Py_DECREF(__pyx_4); __pyx_4 = 0;
          __pyx_9 = PyObject_IsTrue(__pyx_8); if (__pyx_9 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 200; goto __pyx_L1;}
          Py_DECREF(__pyx_8); __pyx_8 = 0;
          __pyx_1 = (!__pyx_9);
        }
        __pyx_7 = PyInt_FromLong(__pyx_1); if (!__pyx_7) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 200; goto __pyx_L1;}
      }
      __pyx_9 = PyObject_IsTrue(__pyx_7); if (__pyx_9 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 200; goto __pyx_L1;}
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      if (__pyx_9) {

        /* "/home/jiba/src/soya/ode/model.pyx":202 */
        (__pyx_v_indices[0]) = __pyx_v_v4;

        /* "/home/jiba/src/soya/ode/model.pyx":203 */
        (__pyx_v_indices[1]) = __pyx_v_v3;

        /* "/home/jiba/src/soya/ode/model.pyx":204 */
        (__pyx_v_indices[2]) = __pyx_v_v1;

        /* "/home/jiba/src/soya/ode/model.pyx":205 */
        (__pyx_v_indices[3]) = __pyx_v_v2;

        /* "/home/jiba/src/soya/ode/model.pyx":206 */
        (__pyx_v_indices[4]) = __pyx_v_v1;

        /* "/home/jiba/src/soya/ode/model.pyx":207 */
        (__pyx_v_indices[5]) = __pyx_v_v3;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "/home/jiba/src/soya/ode/model.pyx":210 */
        (__pyx_v_indices[0]) = __pyx_v_v1;

        /* "/home/jiba/src/soya/ode/model.pyx":211 */
        (__pyx_v_indices[1]) = __pyx_v_v4;

        /* "/home/jiba/src/soya/ode/model.pyx":212 */
        (__pyx_v_indices[2]) = __pyx_v_v2;

        /* "/home/jiba/src/soya/ode/model.pyx":213 */
        (__pyx_v_indices[3]) = __pyx_v_v3;

        /* "/home/jiba/src/soya/ode/model.pyx":214 */
        (__pyx_v_indices[4]) = __pyx_v_v2;

        /* "/home/jiba/src/soya/ode/model.pyx":215 */
        (__pyx_v_indices[5]) = __pyx_v_v4;
      }
      __pyx_L7:;

      /* "/home/jiba/src/soya/ode/model.pyx":217 */
      __pyx_v_indices = (__pyx_v_indices + 6);
      __pyx_L5:;
    }
    __pyx_L6:;
    __pyx_L3:;
  }
  __pyx_L4:;

  /* "/home/jiba/src/soya/ode/model.pyx":219 */
  dGeomTriMeshDataBuildSingle1(((struct __pyx_obj_4_ode__GeomTerrain *)__pyx_v_self)->__pyx_base._data,(__pyx_v_terrain->_vertices[0]).coord,(sizeof((__pyx_v_terrain->_vertices[0]))),__pyx_v_nvertices,((struct __pyx_obj_4_ode__GeomTerrain *)__pyx_v_self)->_indices,(__pyx_v_ntris * 3),(3 * (sizeof(int ))),0);

  /* "/home/jiba/src/soya/ode/model.pyx":221 */
  ((struct __pyx_obj_4_ode__GeomTerrain *)__pyx_v_self)->__pyx_base.__pyx_base.gid = dCreateTriMesh(__pyx_v_sid,((struct __pyx_obj_4_ode__GeomTerrain *)__pyx_v_self)->__pyx_base._data,0,0,0);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  Py_XDECREF(__pyx_8);
  __Pyx_AddTraceback("_ode._GeomTerrain.__new__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kw);
  Py_DECREF(__pyx_v_j);
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_terrain);
  Py_DECREF((PyObject *)__pyx_v_space);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

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

  /* "/home/jiba/src/soya/ode/model.pyx":224 */
  free(((struct __pyx_obj_4_ode__GeomTerrain *)__pyx_v_self)->_indices);

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

static int __pyx_f_4_ode_12_GeomTerrain___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4_ode_12_GeomTerrain___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5_soya__Terrain *__pyx_v_terrain = 0;
  struct __pyx_obj_4_ode_SpaceBase *__pyx_v_space = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"terrain","space",0};
  __pyx_v_space = __pyx_k77;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_terrain, &__pyx_v_space)) return -1;
  Py_INCREF((PyObject *)__pyx_v_self);
  Py_INCREF((PyObject *)__pyx_v_terrain);
  Py_INCREF((PyObject *)__pyx_v_space);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_terrain), __pyx_ptype_5_soya__Terrain, 1, "terrain")) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 226; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), __pyx_ptype_4_ode_SpaceBase, 1, "space")) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 226; goto __pyx_L1;}

  /* "/home/jiba/src/soya/ode/model.pyx":227 */
  __pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4_ode_GeomObject), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 227; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 227; goto __pyx_L1;}
  Py_INCREF((PyObject *)__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
  Py_INCREF((PyObject *)((PyObject *)__pyx_v_terrain->__pyx_base.__pyx_base._parent));
  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_terrain->__pyx_base.__pyx_base._parent));
  Py_INCREF((PyObject *)((PyObject *)__pyx_v_space));
  PyTuple_SET_ITEM(__pyx_2, 2, ((PyObject *)__pyx_v_space));
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 227; 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 = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("_ode._GeomTerrain.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  Py_DECREF((PyObject *)__pyx_v_terrain);
  Py_DECREF((PyObject *)__pyx_v_space);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_12_GeomTerrain_placeable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4_ode_12_GeomTerrain_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/model.pyx":230 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 230; 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._GeomTerrain.placeable");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF((PyObject *)__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_k116p;

static char (__pyx_k116[]) = "max_contacts must be between 1 and 150";

static PyObject *__pyx_f_4_ode_collide(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_collide(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4_ode_GeomObject *__pyx_v_geom1 = 0;
  struct __pyx_obj_4_ode_GeomObject *__pyx_v_geom2 = 0;
  int __pyx_v_max_contacts;
  dContactGeom (__pyx_v_c[150]);
  int __pyx_v_i;
  int __pyx_v_n;
  struct __pyx_obj_4_ode_Contact *__pyx_v_cont;
  PyObject *__pyx_v_res;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"geom1","geom2","max_contacts",0};
  __pyx_v_max_contacts = __pyx_k78;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|i", __pyx_argnames, &__pyx_v_geom1, &__pyx_v_geom2, &__pyx_v_max_contacts)) return 0;
  Py_INCREF((PyObject *)__pyx_v_geom1);
  Py_INCREF((PyObject *)__pyx_v_geom2);
  __pyx_v_cont = Py_None; Py_INCREF((PyObject *) __pyx_v_cont);
  __pyx_v_res = Py_None; Py_INCREF(__pyx_v_res);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom1), __pyx_ptype_4_ode_GeomObject, 1, "geom1")) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 170; goto __pyx_L1;}
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom2), __pyx_ptype_4_ode_GeomObject, 1, "geom2")) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 170; goto __pyx_L1;}

  /* "/home/jiba/src/soya/_ode.pyx":193 */
  __pyx_1 = (__pyx_v_max_contacts < 1);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_max_contacts > 150);
  }
  if (__pyx_1) {

    /* "/home/jiba/src/soya/_ode.pyx":194 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 194; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k116p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[10]; __pyx_lineno = 194; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/jiba/src/soya/_ode.pyx":196 */
  __pyx_v_n = dCollide(__pyx_v_geom1->gid,__pyx_v_geom2->gid,__pyx_v_max_contacts,__pyx_v_c,(sizeof(dContactGeom )));

  /* "/home/jiba/src/soya/_ode.pyx":197 */
  __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 197; goto __pyx_L1;}
  Py_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_2;
  __pyx_2 = 0;

  /* "/home/jiba/src/soya/_ode.pyx":198 */
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {

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

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

    /* "/home/jiba/src/soya/_ode.pyx":201 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_res, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 201; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 201; goto __pyx_L1;}
    Py_INCREF(((PyObject *)__pyx_v_cont));
    PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_cont));
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 201; 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:;
  }
  __pyx_L4:;

  /* "/home/jiba/src/soya/_ode.pyx":207 */
  __pyx_2 = PyInt_FromLong(__pyx_v_n); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 207; goto __pyx_L1;}
  __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 207; goto __pyx_L1;}
  if (__pyx_1) {
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 207; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 207; goto __pyx_L1;}
    Py_INCREF((PyObject *)((PyObject *)__pyx_v_geom1));
    PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_geom1));
    Py_INCREF(((PyObject*)__pyx_ptype_4_ode__TriMesh));
    PyTuple_SET_ITEM(__pyx_4, 1, ((PyObject*)__pyx_ptype_4_ode__TriMesh));
    __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 207; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 207; goto __pyx_L1;}
    if (__pyx_1) {
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 207; goto __pyx_L1;}
      __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 207; goto __pyx_L1;}
      Py_INCREF((PyObject *)((PyObject *)__pyx_v_geom2));
      PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_geom2));
      Py_INCREF(((PyObject*)__pyx_ptype_4_ode__TriMesh));
      PyTuple_SET_ITEM(__pyx_4, 1, ((PyObject*)__pyx_ptype_4_ode__TriMesh));
      __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 207; goto __pyx_L1;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
    }
  }
  __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 207; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_1) {

    /* "/home/jiba/src/soya/_ode.pyx":208 */
    ((struct __pyx_obj_4_ode__TriMesh *)((PyObject *)__pyx_v_geom1))->_colliding = 1;

    /* "/home/jiba/src/soya/_ode.pyx":209 */
    ((struct __pyx_obj_4_ode__TriMesh *)((PyObject *)__pyx_v_geom2))->_colliding = 1;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/jiba/src/soya/_ode.pyx":211 */
  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_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("_ode.collide");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_cont);
  Py_DECREF(__pyx_v_res);
  Py_DECREF((PyObject *)__pyx_v_geom1);
  Py_DECREF((PyObject *)__pyx_v_geom2);
  return __pyx_r;
}

static PyObject *__pyx_f_4_ode_CloseODE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4_ode_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_4_ode_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.pyx":219 */
  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_True, "True"},
  {&__pyx_n_ValueError, "ValueError"},
  {&__pyx_n___doc__, "__doc__"},
  {&__pyx_n___init__, "__init__"},
  {&__pyx_n__addjoint, "_addjoint"},
  {&__pyx_n__create, "_create"},
  {&__pyx_n__destroyed, "_destroyed"},
  {&__pyx_n__remove_joint, "_remove_joint"},
  {&__pyx_n__soya, "_soya"},
  {&__pyx_n_add, "add"},
  {&__pyx_n_adjust, "adjust"},
  {&__pyx_n_advance_time, "advance_time"},
  {&__pyx_n_append, "append"},
  {&__pyx_n_begin_round, "begin_round"},
  {&__pyx_n_c, "c"},
  {&__pyx_n_collide, "collide"},
  {&__pyx_n_dealloc, "dealloc"},
  {&__pyx_n_environment, "environment"},
  {&__pyx_n_isinstance, "isinstance"},
  {&__pyx_n_mass, "mass"},
  {&__pyx_n_max, "max"},
  {&__pyx_n_min, "min"},
  {&__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_remove, "remove"},
  {&__pyx_n_setFeedback, "setFeedback"},
  {&__pyx_n_str, "str"},
  {0, 0}
};

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_k33p, __pyx_k33, sizeof(__pyx_k33)},
  {&__pyx_k82p, __pyx_k82, sizeof(__pyx_k82)},
  {&__pyx_k83p, __pyx_k83, sizeof(__pyx_k83)},
  {&__pyx_k86p, __pyx_k86, sizeof(__pyx_k86)},
  {&__pyx_k88p, __pyx_k88, sizeof(__pyx_k88)},
  {&__pyx_k89p, __pyx_k89, sizeof(__pyx_k89)},
  {&__pyx_k90p, __pyx_k90, sizeof(__pyx_k90)},
  {&__pyx_k91p, __pyx_k91, sizeof(__pyx_k91)},
  {&__pyx_k92p, __pyx_k92, sizeof(__pyx_k92)},
  {&__pyx_k93p, __pyx_k93, sizeof(__pyx_k93)},
  {&__pyx_k95p, __pyx_k95, sizeof(__pyx_k95)},
  {&__pyx_k96p, __pyx_k96, sizeof(__pyx_k96)},
  {&__pyx_k97p, __pyx_k97, sizeof(__pyx_k97)},
  {&__pyx_k98p, __pyx_k98, sizeof(__pyx_k98)},
  {&__pyx_k101p, __pyx_k101, sizeof(__pyx_k101)},
  {&__pyx_k104p, __pyx_k104, sizeof(__pyx_k104)},
  {&__pyx_k105p, __pyx_k105, sizeof(__pyx_k105)},
  {&__pyx_k112p, __pyx_k112, sizeof(__pyx_k112)},
  {&__pyx_k115p, __pyx_k115, sizeof(__pyx_k115)},
  {&__pyx_k116p, __pyx_k116, sizeof(__pyx_k116)},
  {0, 0, 0}
};

static PyObject *__pyx_tp_new_4_ode_Mass(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  struct __pyx_obj_4_ode_Mass *p = (struct __pyx_obj_4_ode_Mass *)o;
  if (__pyx_f_4_ode_4Mass___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_Mass(PyObject *o) {
  struct __pyx_obj_4_ode_Mass *p = (struct __pyx_obj_4_ode_Mass *)o;
  (*o->ob_type->tp_free)(o);
}

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

static int __pyx_tp_clear_4_ode_Mass(PyObject *o) {
  struct __pyx_obj_4_ode_Mass *p = (struct __pyx_obj_4_ode_Mass *)o;
  return 0;
}

static PyObject *__pyx_tp_getattro_4_ode_Mass(PyObject *o, PyObject *n) {
  PyObject *v = PyObject_GenericGetAttr(o, n);
  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
    PyErr_Clear();
    v = __pyx_f_4_ode_4Mass___getattr__(o, n);
  }
  return v;
}

static int __pyx_tp_setattro_4_ode_Mass(PyObject *o, PyObject *n, PyObject *v) {
  if (v) {
    return __pyx_f_4_ode_4Mass___setattr__(o, n, v);
  }
  else {
    return PyObject_GenericSetAttr(o, n, 0);
  }
}

static struct PyMethodDef __pyx_methods_4_ode_Mass[] = {
  {"setZero", (PyCFunction)__pyx_f_4_ode_4Mass_setZero, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_4Mass_setZero},
  {"setParameters", (PyCFunction)__pyx_f_4_ode_4Mass_setParameters, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_4Mass_setParameters},
  {"setSphere", (PyCFunction)__pyx_f_4_ode_4Mass_setSphere, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_4Mass_setSphere},
  {"setCappedCylinder", (PyCFunction)__pyx_f_4_ode_4Mass_setCappedCylinder, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_4Mass_setCappedCylinder},
  {"setCylinder", (PyCFunction)__pyx_f_4_ode_4Mass_setCylinder, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_4Mass_setCylinder},
  {"setBox", (PyCFunction)__pyx_f_4_ode_4Mass_setBox, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_4Mass_setBox},
  {"adjust", (PyCFunction)__pyx_f_4_ode_4Mass_adjust, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_4Mass_adjust},
  {"translate", (PyCFunction)__pyx_f_4_ode_4Mass_translate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_4Mass_translate},
  {"add", (PyCFunction)__pyx_f_4_ode_4Mass_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_4Mass_add},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Mass = {
  __pyx_f_4_ode_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_4_ode_Mass = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.Mass", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_Mass), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_4Mass___str__, /*tp_str*/
  __pyx_tp_getattro_4_ode_Mass, /*tp_getattro*/
  __pyx_tp_setattro_4_ode_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_4_ode_Mass, /*tp_traverse*/
  __pyx_tp_clear_4_ode_Mass, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_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_4_ode_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 struct __pyx_vtabstruct_4_ode_GeomObject __pyx_vtable_4_ode_GeomObject;

static PyObject *__pyx_tp_new_4_ode_GeomObject(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_5_soya_CoordSyst->tp_new(t, a, k);
  struct __pyx_obj_4_ode_GeomObject *p = (struct __pyx_obj_4_ode_GeomObject *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_GeomObject *)__pyx_vtabptr_4_ode_GeomObject;
  p->space = Py_None; Py_INCREF((PyObject *) p->space);
  p->_body = Py_None; Py_INCREF((PyObject *) p->_body);
  p->world = Py_None; Py_INCREF((PyObject *) p->world);
  if (__pyx_f_4_ode_10GeomObject___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_GeomObject(PyObject *o) {
  struct __pyx_obj_4_ode_GeomObject *p = (struct __pyx_obj_4_ode_GeomObject *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_4_ode_10GeomObject___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF((PyObject *)p->space);
  Py_XDECREF((PyObject *)p->_body);
  Py_XDECREF((PyObject *)p->world);
  __pyx_ptype_5_soya_CoordSyst->tp_dealloc(o);
}

static int __pyx_tp_traverse_4_ode_GeomObject(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4_ode_GeomObject *p = (struct __pyx_obj_4_ode_GeomObject *)o;
  __pyx_ptype_5_soya_CoordSyst->tp_traverse(o, v, a);
  if (p->space) {
    e = (*v)(((PyObject*)p->space), a); if (e) return e;
  }
  if (p->_body) {
    e = (*v)(((PyObject*)p->_body), a); if (e) return e;
  }
  if (p->world) {
    e = (*v)(((PyObject*)p->world), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4_ode_GeomObject(PyObject *o) {
  struct __pyx_obj_4_ode_GeomObject *p = (struct __pyx_obj_4_ode_GeomObject *)o;
  __pyx_ptype_5_soya_CoordSyst->tp_clear(o);
  Py_XDECREF((PyObject *)p->space);
  p->space = Py_None; Py_INCREF((PyObject *) p->space);
  Py_XDECREF((PyObject *)p->_body);
  p->_body = Py_None; Py_INCREF((PyObject *) p->_body);
  Py_XDECREF((PyObject *)p->world);
  p->world = Py_None; Py_INCREF((PyObject *) p->world);
  return 0;
}

static PyObject *__pyx_getprop_4_ode_10GeomObject_body(PyObject *o, void *x) {
  return __pyx_f_4_ode_10GeomObject_4body___get__(o);
}

static PyObject *__pyx_getprop_4_ode_10GeomObject_enabled(PyObject *o, void *x) {
  return __pyx_f_4_ode_10GeomObject_7enabled___get__(o);
}

static int __pyx_setprop_4_ode_10GeomObject_enabled(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_10GeomObject_7enabled___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static struct PyMethodDef __pyx_methods_4_ode_GeomObject[] = {
  {"point_depth", (PyCFunction)__pyx_f_4_ode_10GeomObject_point_depth, METH_VARARGS|METH_KEYWORDS, 0},
  {"placeable", (PyCFunction)__pyx_f_4_ode_10GeomObject_placeable, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_10GeomObject_placeable},
  {"begin_round", (PyCFunction)__pyx_f_4_ode_10GeomObject_begin_round, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_10GeomObject_begin_round},
  {"getAABB", (PyCFunction)__pyx_f_4_ode_10GeomObject_getAABB, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_10GeomObject_getAABB},
  {"isSpace", (PyCFunction)__pyx_f_4_ode_10GeomObject_isSpace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_10GeomObject_isSpace},
  {"getSpace", (PyCFunction)__pyx_f_4_ode_10GeomObject_getSpace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_10GeomObject_getSpace},
  {"setCollideBits", (PyCFunction)__pyx_f_4_ode_10GeomObject_setCollideBits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_10GeomObject_setCollideBits},
  {"setCategoryBits", (PyCFunction)__pyx_f_4_ode_10GeomObject_setCategoryBits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_10GeomObject_setCategoryBits},
  {"getCollideBits", (PyCFunction)__pyx_f_4_ode_10GeomObject_getCollideBits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_10GeomObject_getCollideBits},
  {"getCategoryBits", (PyCFunction)__pyx_f_4_ode_10GeomObject_getCategoryBits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_10GeomObject_getCategoryBits},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode_GeomObject[] = {
  {"body", __pyx_getprop_4_ode_10GeomObject_body, 0, 0, 0},
  {"enabled", __pyx_getprop_4_ode_10GeomObject_enabled, __pyx_setprop_4_ode_10GeomObject_enabled, 0, 0},
  {0, 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_4_ode_GeomObject = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.GeomObject", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_GeomObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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*/
  0, /*tp_getattro*/
  0, /*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_4_ode_GeomObject, /*tp_traverse*/
  __pyx_tp_clear_4_ode_GeomObject, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_GeomObject, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4_ode_GeomObject, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_4_ode_10GeomObject___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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_4_ode_Contact(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  struct __pyx_obj_4_ode_Contact *p = (struct __pyx_obj_4_ode_Contact *)o;
  if (__pyx_f_4_ode_7Contact___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_Contact(PyObject *o) {
  struct __pyx_obj_4_ode_Contact *p = (struct __pyx_obj_4_ode_Contact *)o;
  (*o->ob_type->tp_free)(o);
}

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

static int __pyx_tp_clear_4_ode_Contact(PyObject *o) {
  struct __pyx_obj_4_ode_Contact *p = (struct __pyx_obj_4_ode_Contact *)o;
  return 0;
}

static PyObject *__pyx_getprop_4_ode_7Contact_mode(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_4mode___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_mode(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_4mode___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_mu(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_2mu___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_mu(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_2mu___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_mu2(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_3mu2___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_mu2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_3mu2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_bounce(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_6bounce___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_bounce(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_6bounce___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_bounce_vel(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_10bounce_vel___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_bounce_vel(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_10bounce_vel___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_soft_erp(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_8soft_erp___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_soft_erp(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_8soft_erp___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_soft_cfm(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_8soft_cfm___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_soft_cfm(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_8soft_cfm___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_motion1(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_7motion1___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_motion1(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_7motion1___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_motion2(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_7motion2___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_motion2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_7motion2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_slip1(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_5slip1___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_slip1(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_5slip1___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_slip2(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_5slip2___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_slip2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_5slip2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_pos(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_3pos___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_pos(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_3pos___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_normal(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_6normal___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_normal(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_6normal___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_depth(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_5depth___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_depth(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_5depth___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_g1(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_2g1___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_g1(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_2g1___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_7Contact_g2(PyObject *o, void *x) {
  return __pyx_f_4_ode_7Contact_2g2___get__(o);
}

static int __pyx_setprop_4_ode_7Contact_g2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7Contact_2g2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static struct PyMethodDef __pyx_methods_4_ode_Contact[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode_Contact[] = {
  {"mode", __pyx_getprop_4_ode_7Contact_mode, __pyx_setprop_4_ode_7Contact_mode, 0, 0},
  {"mu", __pyx_getprop_4_ode_7Contact_mu, __pyx_setprop_4_ode_7Contact_mu, 0, 0},
  {"mu2", __pyx_getprop_4_ode_7Contact_mu2, __pyx_setprop_4_ode_7Contact_mu2, 0, 0},
  {"bounce", __pyx_getprop_4_ode_7Contact_bounce, __pyx_setprop_4_ode_7Contact_bounce, 0, 0},
  {"bounce_vel", __pyx_getprop_4_ode_7Contact_bounce_vel, __pyx_setprop_4_ode_7Contact_bounce_vel, 0, 0},
  {"soft_erp", __pyx_getprop_4_ode_7Contact_soft_erp, __pyx_setprop_4_ode_7Contact_soft_erp, 0, 0},
  {"soft_cfm", __pyx_getprop_4_ode_7Contact_soft_cfm, __pyx_setprop_4_ode_7Contact_soft_cfm, 0, 0},
  {"motion1", __pyx_getprop_4_ode_7Contact_motion1, __pyx_setprop_4_ode_7Contact_motion1, 0, 0},
  {"motion2", __pyx_getprop_4_ode_7Contact_motion2, __pyx_setprop_4_ode_7Contact_motion2, 0, 0},
  {"slip1", __pyx_getprop_4_ode_7Contact_slip1, __pyx_setprop_4_ode_7Contact_slip1, 0, 0},
  {"slip2", __pyx_getprop_4_ode_7Contact_slip2, __pyx_setprop_4_ode_7Contact_slip2, 0, 0},
  {"pos", __pyx_getprop_4_ode_7Contact_pos, __pyx_setprop_4_ode_7Contact_pos, __pyx_k1, 0},
  {"normal", __pyx_getprop_4_ode_7Contact_normal, __pyx_setprop_4_ode_7Contact_normal, __pyx_k2, 0},
  {"depth", __pyx_getprop_4_ode_7Contact_depth, __pyx_setprop_4_ode_7Contact_depth, __pyx_k3, 0},
  {"g1", __pyx_getprop_4_ode_7Contact_g1, __pyx_setprop_4_ode_7Contact_g1, __pyx_k4, 0},
  {"g2", __pyx_getprop_4_ode_7Contact_g2, __pyx_setprop_4_ode_7Contact_g2, __pyx_k5, 0},
  {0, 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_4_ode_Contact = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.Contact", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_Contact), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_Contact, /*tp_traverse*/
  __pyx_tp_clear_4_ode_Contact, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_Contact, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4_ode_Contact, /*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_4_ode_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 struct __pyx_vtabstruct_4_ode__Body __pyx_vtable_4_ode__Body;

static PyObject *__pyx_tp_new_4_ode__Body(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_5_soya__World->tp_new(t, a, k);
  struct __pyx_obj_4_ode__Body *p = (struct __pyx_obj_4_ode__Body *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode__Body *)__pyx_vtabptr_4_ode__Body;
  p->joints = Py_None; Py_INCREF(p->joints);
  if (__pyx_f_4_ode_5_Body___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode__Body(PyObject *o) {
  struct __pyx_obj_4_ode__Body *p = (struct __pyx_obj_4_ode__Body *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_4_ode_5_Body___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(p->joints);
  __pyx_ptype_5_soya__World->tp_dealloc(o);
}

static int __pyx_tp_traverse_4_ode__Body(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4_ode__Body *p = (struct __pyx_obj_4_ode__Body *)o;
  __pyx_ptype_5_soya__World->tp_traverse(o, v, a);
  if (p->joints) {
    e = (*v)(p->joints, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4_ode__Body(PyObject *o) {
  struct __pyx_obj_4_ode__Body *p = (struct __pyx_obj_4_ode__Body *)o;
  __pyx_ptype_5_soya__World->tp_clear(o);
  Py_XDECREF(p->joints);
  p->joints = Py_None; Py_INCREF(p->joints);
  return 0;
}

static PyObject *__pyx_getprop_4_ode_5_Body_linear_velocity(PyObject *o, void *x) {
  return __pyx_f_4_ode_5_Body_15linear_velocity___get__(o);
}

static int __pyx_setprop_4_ode_5_Body_linear_velocity(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5_Body_15linear_velocity___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5_Body_angular_velocity(PyObject *o, void *x) {
  return __pyx_f_4_ode_5_Body_16angular_velocity___get__(o);
}

static int __pyx_setprop_4_ode_5_Body_angular_velocity(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5_Body_16angular_velocity___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5_Body_mass(PyObject *o, void *x) {
  return __pyx_f_4_ode_5_Body_4mass___get__(o);
}

static int __pyx_setprop_4_ode_5_Body_mass(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5_Body_4mass___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5_Body_enabled(PyObject *o, void *x) {
  return __pyx_f_4_ode_5_Body_7enabled___get__(o);
}

static int __pyx_setprop_4_ode_5_Body_enabled(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5_Body_7enabled___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5_Body_finite_rotation_mode(PyObject *o, void *x) {
  return __pyx_f_4_ode_5_Body_20finite_rotation_mode___get__(o);
}

static int __pyx_setprop_4_ode_5_Body_finite_rotation_mode(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5_Body_20finite_rotation_mode___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5_Body_finite_rotation_axis(PyObject *o, void *x) {
  return __pyx_f_4_ode_5_Body_20finite_rotation_axis___get__(o);
}

static int __pyx_setprop_4_ode_5_Body_finite_rotation_axis(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5_Body_20finite_rotation_axis___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5_Body_num_joints(PyObject *o, void *x) {
  return __pyx_f_4_ode_5_Body_10num_joints___get__(o);
}

static PyObject *__pyx_getprop_4_ode_5_Body_gravity_mode(PyObject *o, void *x) {
  return __pyx_f_4_ode_5_Body_12gravity_mode___get__(o);
}

static int __pyx_setprop_4_ode_5_Body_gravity_mode(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5_Body_12gravity_mode___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static struct PyMethodDef __pyx_methods_4_ode__Body[] = {
  {"begin_round", (PyCFunction)__pyx_f_4_ode_5_Body_begin_round, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_begin_round},
  {"advance_time", (PyCFunction)__pyx_f_4_ode_5_Body_advance_time, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_advance_time},
  {"addForce", (PyCFunction)__pyx_f_4_ode_5_Body_addForce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_addForce},
  {"addTorque", (PyCFunction)__pyx_f_4_ode_5_Body_addTorque, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_addTorque},
  {"addRelForce", (PyCFunction)__pyx_f_4_ode_5_Body_addRelForce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_addRelForce},
  {"addRelTorque", (PyCFunction)__pyx_f_4_ode_5_Body_addRelTorque, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_addRelTorque},
  {"addForceAtPos", (PyCFunction)__pyx_f_4_ode_5_Body_addForceAtPos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_addForceAtPos},
  {"addForceAtRelPos", (PyCFunction)__pyx_f_4_ode_5_Body_addForceAtRelPos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_addForceAtRelPos},
  {"addRelForceAtPos", (PyCFunction)__pyx_f_4_ode_5_Body_addRelForceAtPos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_addRelForceAtPos},
  {"addRelForceAtRelPos", (PyCFunction)__pyx_f_4_ode_5_Body_addRelForceAtRelPos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_addRelForceAtRelPos},
  {"getForce", (PyCFunction)__pyx_f_4_ode_5_Body_getForce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_getForce},
  {"getTorque", (PyCFunction)__pyx_f_4_ode_5_Body_getTorque, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_getTorque},
  {"setForce", (PyCFunction)__pyx_f_4_ode_5_Body_setForce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_setForce},
  {"setTorque", (PyCFunction)__pyx_f_4_ode_5_Body_setTorque, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_setTorque},
  {"getRelPointPos", (PyCFunction)__pyx_f_4_ode_5_Body_getRelPointPos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_getRelPointPos},
  {"getRelPointVel", (PyCFunction)__pyx_f_4_ode_5_Body_getRelPointVel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_getRelPointVel},
  {"getPointVel", (PyCFunction)__pyx_f_4_ode_5_Body_getPointVel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_getPointVel},
  {"getPosRelPoint", (PyCFunction)__pyx_f_4_ode_5_Body_getPosRelPoint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_getPosRelPoint},
  {"vectorToWorld", (PyCFunction)__pyx_f_4_ode_5_Body_vectorToWorld, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_vectorToWorld},
  {"vectorFromWorld", (PyCFunction)__pyx_f_4_ode_5_Body_vectorFromWorld, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5_Body_vectorFromWorld},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4_ode__Body[] = {
  {"joints", T_OBJECT, offsetof(struct __pyx_obj_4_ode__Body, joints), READONLY, 0},
  {0, 0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode__Body[] = {
  {"linear_velocity", __pyx_getprop_4_ode_5_Body_linear_velocity, __pyx_setprop_4_ode_5_Body_linear_velocity, 0, 0},
  {"angular_velocity", __pyx_getprop_4_ode_5_Body_angular_velocity, __pyx_setprop_4_ode_5_Body_angular_velocity, 0, 0},
  {"mass", __pyx_getprop_4_ode_5_Body_mass, __pyx_setprop_4_ode_5_Body_mass, 0, 0},
  {"enabled", __pyx_getprop_4_ode_5_Body_enabled, __pyx_setprop_4_ode_5_Body_enabled, 0, 0},
  {"finite_rotation_mode", __pyx_getprop_4_ode_5_Body_finite_rotation_mode, __pyx_setprop_4_ode_5_Body_finite_rotation_mode, 0, 0},
  {"finite_rotation_axis", __pyx_getprop_4_ode_5_Body_finite_rotation_axis, __pyx_setprop_4_ode_5_Body_finite_rotation_axis, 0, 0},
  {"num_joints", __pyx_getprop_4_ode_5_Body_num_joints, 0, 0, 0},
  {"gravity_mode", __pyx_getprop_4_ode_5_Body_gravity_mode, __pyx_setprop_4_ode_5_Body_gravity_mode, 0, 0},
  {0, 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_4_ode__Body = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode._Body", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode__Body), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode__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*/
  0, /*tp_getattro*/
  0, /*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_4_ode__Body, /*tp_traverse*/
  __pyx_tp_clear_4_ode__Body, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode__Body, /*tp_methods*/
  __pyx_members_4_ode__Body, /*tp_members*/
  __pyx_getsets_4_ode__Body, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_4_ode_5_Body___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode__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 struct __pyx_vtabstruct_4_ode__World __pyx_vtable_4_ode__World;

static PyObject *__pyx_tp_new_4_ode__World(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_5_soya__World->tp_new(t, a, k);
  struct __pyx_obj_4_ode__World *p = (struct __pyx_obj_4_ode__World *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode__World *)__pyx_vtabptr_4_ode__World;
  if (__pyx_f_4_ode_6_World___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode__World(PyObject *o) {
  struct __pyx_obj_4_ode__World *p = (struct __pyx_obj_4_ode__World *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_4_ode_6_World___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_ptype_5_soya__World->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode__World(PyObject *o) {
  struct __pyx_obj_4_ode__World *p = (struct __pyx_obj_4_ode__World *)o;
  __pyx_ptype_5_soya__World->tp_clear(o);
  return 0;
}

static PyObject *__pyx_getprop_4_ode_6_World_gravity(PyObject *o, void *x) {
  return __pyx_f_4_ode_6_World_7gravity___get__(o);
}

static int __pyx_setprop_4_ode_6_World_gravity(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_6_World_7gravity___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_6_World_erp(PyObject *o, void *x) {
  return __pyx_f_4_ode_6_World_3erp___get__(o);
}

static int __pyx_setprop_4_ode_6_World_erp(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_6_World_3erp___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_6_World_cfm(PyObject *o, void *x) {
  return __pyx_f_4_ode_6_World_3cfm___get__(o);
}

static int __pyx_setprop_4_ode_6_World_cfm(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_6_World_3cfm___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_6_World_quickstep_num_iterations(PyObject *o, void *x) {
  return __pyx_f_4_ode_6_World_24quickstep_num_iterations___get__(o);
}

static int __pyx_setprop_4_ode_6_World_quickstep_num_iterations(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_6_World_24quickstep_num_iterations___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_6_World_contact_max_correcting_velocity(PyObject *o, void *x) {
  return __pyx_f_4_ode_6_World_31contact_max_correcting_velocity___get__(o);
}

static int __pyx_setprop_4_ode_6_World_contact_max_correcting_velocity(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_6_World_31contact_max_correcting_velocity___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_6_World_contact_surface_layer(PyObject *o, void *x) {
  return __pyx_f_4_ode_6_World_21contact_surface_layer___get__(o);
}

static int __pyx_setprop_4_ode_6_World_contact_surface_layer(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_6_World_21contact_surface_layer___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_6_World_auto_disable(PyObject *o, void *x) {
  return __pyx_f_4_ode_6_World_12auto_disable___get__(o);
}

static int __pyx_setprop_4_ode_6_World_auto_disable(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_6_World_12auto_disable___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_6_World_auto_disable_linear_threshold(PyObject *o, void *x) {
  return __pyx_f_4_ode_6_World_29auto_disable_linear_threshold___get__(o);
}

static int __pyx_setprop_4_ode_6_World_auto_disable_linear_threshold(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_6_World_29auto_disable_linear_threshold___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_6_World_auto_disable_angular_threshold(PyObject *o, void *x) {
  return __pyx_f_4_ode_6_World_30auto_disable_angular_threshold___get__(o);
}

static int __pyx_setprop_4_ode_6_World_auto_disable_angular_threshold(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_6_World_30auto_disable_angular_threshold___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_6_World_auto_disable_steps(PyObject *o, void *x) {
  return __pyx_f_4_ode_6_World_18auto_disable_steps___get__(o);
}

static int __pyx_setprop_4_ode_6_World_auto_disable_steps(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_6_World_18auto_disable_steps___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_6_World_auto_disable_time(PyObject *o, void *x) {
  return __pyx_f_4_ode_6_World_17auto_disable_time___get__(o);
}

static int __pyx_setprop_4_ode_6_World_auto_disable_time(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_6_World_17auto_disable_time___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static struct PyMethodDef __pyx_methods_4_ode__World[] = {
  {"begin_round", (PyCFunction)__pyx_f_4_ode_6_World_begin_round, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_6_World_begin_round},
  {"impulseToForce", (PyCFunction)__pyx_f_4_ode_6_World_impulseToForce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_6_World_impulseToForce},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4_ode__World[] = {
  {"steptime", T_DOUBLE, offsetof(struct __pyx_obj_4_ode__World, steptime), 0, 0},
  {0, 0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode__World[] = {
  {"gravity", __pyx_getprop_4_ode_6_World_gravity, __pyx_setprop_4_ode_6_World_gravity, __pyx_k6, 0},
  {"erp", __pyx_getprop_4_ode_6_World_erp, __pyx_setprop_4_ode_6_World_erp, __pyx_k7, 0},
  {"cfm", __pyx_getprop_4_ode_6_World_cfm, __pyx_setprop_4_ode_6_World_cfm, __pyx_k8, 0},
  {"quickstep_num_iterations", __pyx_getprop_4_ode_6_World_quickstep_num_iterations, __pyx_setprop_4_ode_6_World_quickstep_num_iterations, __pyx_k9, 0},
  {"contact_max_correcting_velocity", __pyx_getprop_4_ode_6_World_contact_max_correcting_velocity, __pyx_setprop_4_ode_6_World_contact_max_correcting_velocity, __pyx_k10, 0},
  {"contact_surface_layer", __pyx_getprop_4_ode_6_World_contact_surface_layer, __pyx_setprop_4_ode_6_World_contact_surface_layer, __pyx_k11, 0},
  {"auto_disable", __pyx_getprop_4_ode_6_World_auto_disable, __pyx_setprop_4_ode_6_World_auto_disable, __pyx_k12, 0},
  {"auto_disable_linear_threshold", __pyx_getprop_4_ode_6_World_auto_disable_linear_threshold, __pyx_setprop_4_ode_6_World_auto_disable_linear_threshold, __pyx_k13, 0},
  {"auto_disable_angular_threshold", __pyx_getprop_4_ode_6_World_auto_disable_angular_threshold, __pyx_setprop_4_ode_6_World_auto_disable_angular_threshold, __pyx_k14, 0},
  {"auto_disable_steps", __pyx_getprop_4_ode_6_World_auto_disable_steps, __pyx_setprop_4_ode_6_World_auto_disable_steps, __pyx_k15, 0},
  {"auto_disable_time", __pyx_getprop_4_ode_6_World_auto_disable_time, __pyx_setprop_4_ode_6_World_auto_disable_time, __pyx_k16, 0},
  {0, 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_4_ode__World = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode._World", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode__World), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode__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 simulation object is a container for rigid bodies and joints.\n		\n		\n		Constructor::\n		\n			_World()\n		", /*tp_doc*/
  __pyx_tp_traverse_4_ode__World, /*tp_traverse*/
  __pyx_tp_clear_4_ode__World, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode__World, /*tp_methods*/
  __pyx_members_4_ode__World, /*tp_members*/
  __pyx_getsets_4_ode__World, /*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_4_ode__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 struct __pyx_vtabstruct_4_ode_Joint __pyx_vtable_4_ode_Joint;

static PyObject *__pyx_tp_new_4_ode_Joint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  struct __pyx_obj_4_ode_Joint *p = (struct __pyx_obj_4_ode_Joint *)o;
  p->__pyx_vtab = (struct __pyx_vtabstruct_4_ode_Joint *)__pyx_vtabptr_4_ode_Joint;
  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_4_ode_5Joint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_Joint(PyObject *o) {
  struct __pyx_obj_4_ode_Joint *p = (struct __pyx_obj_4_ode_Joint *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_4_ode_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_4_ode_Joint(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4_ode_Joint *p = (struct __pyx_obj_4_ode_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_4_ode_Joint(PyObject *o) {
  struct __pyx_obj_4_ode_Joint *p = (struct __pyx_obj_4_ode_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 PyObject *__pyx_getprop_4_ode_5Joint_lo_stop(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_7lo_stop___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_lo_stop(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_7lo_stop___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_hi_stop(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_7hi_stop___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_hi_stop(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_7hi_stop___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_velocity(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_8velocity___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_velocity(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_8velocity___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_fmax(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_4fmax___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_fmax(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_4fmax___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_fudge_factor(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_12fudge_factor___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_fudge_factor(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_12fudge_factor___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_bounce(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_6bounce___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_bounce(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_6bounce___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_cfm(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_3cfm___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_cfm(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_3cfm___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_stop_erp(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_8stop_erp___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_stop_erp(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_8stop_erp___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_stop_cfm(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_8stop_cfm___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_stop_cfm(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_8stop_cfm___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_suspension_erp(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_14suspension_erp___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_suspension_erp(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_14suspension_erp___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_suspension_cfm(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_14suspension_cfm___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_suspension_cfm(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_14suspension_cfm___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_lo_stop2(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_8lo_stop2___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_lo_stop2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_8lo_stop2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_hi_stop2(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_8hi_stop2___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_hi_stop2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_8hi_stop2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_velocity2(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_9velocity2___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_velocity2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_9velocity2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_fmax2(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_5fmax2___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_fmax2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_5fmax2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_fudge_factor2(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_13fudge_factor2___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_fudge_factor2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_13fudge_factor2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_bounce2(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_7bounce2___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_bounce2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_7bounce2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_cfm2(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_4cfm2___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_cfm2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_4cfm2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_stop_erp2(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_9stop_erp2___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_stop_erp2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_9stop_erp2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_stop_cfm2(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_9stop_cfm2___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_stop_cfm2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_9stop_cfm2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_suspension_erp2(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_15suspension_erp2___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_suspension_erp2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_15suspension_erp2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_5Joint_suspension_cfm2(PyObject *o, void *x) {
  return __pyx_f_4_ode_5Joint_15suspension_cfm2___get__(o);
}

static int __pyx_setprop_4_ode_5Joint_suspension_cfm2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_5Joint_15suspension_cfm2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static struct PyMethodDef __pyx_methods_4_ode_Joint[] = {
  {"_destroyed", (PyCFunction)__pyx_f_4_ode_5Joint__destroyed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5Joint__destroyed},
  {"attach", (PyCFunction)__pyx_f_4_ode_5Joint_attach, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5Joint_attach},
  {"setFeedback", (PyCFunction)__pyx_f_4_ode_5Joint_setFeedback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5Joint_setFeedback},
  {"getFeedback", (PyCFunction)__pyx_f_4_ode_5Joint_getFeedback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_5Joint_getFeedback},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4_ode_Joint[] = {
  {"body1", T_OBJECT, offsetof(struct __pyx_obj_4_ode_Joint, body1), READONLY, 0},
  {"body2", T_OBJECT, offsetof(struct __pyx_obj_4_ode_Joint, body2), READONLY, 0},
  {0, 0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode_Joint[] = {
  {"lo_stop", __pyx_getprop_4_ode_5Joint_lo_stop, __pyx_setprop_4_ode_5Joint_lo_stop, 0, 0},
  {"hi_stop", __pyx_getprop_4_ode_5Joint_hi_stop, __pyx_setprop_4_ode_5Joint_hi_stop, 0, 0},
  {"velocity", __pyx_getprop_4_ode_5Joint_velocity, __pyx_setprop_4_ode_5Joint_velocity, 0, 0},
  {"fmax", __pyx_getprop_4_ode_5Joint_fmax, __pyx_setprop_4_ode_5Joint_fmax, 0, 0},
  {"fudge_factor", __pyx_getprop_4_ode_5Joint_fudge_factor, __pyx_setprop_4_ode_5Joint_fudge_factor, 0, 0},
  {"bounce", __pyx_getprop_4_ode_5Joint_bounce, __pyx_setprop_4_ode_5Joint_bounce, 0, 0},
  {"cfm", __pyx_getprop_4_ode_5Joint_cfm, __pyx_setprop_4_ode_5Joint_cfm, 0, 0},
  {"stop_erp", __pyx_getprop_4_ode_5Joint_stop_erp, __pyx_setprop_4_ode_5Joint_stop_erp, 0, 0},
  {"stop_cfm", __pyx_getprop_4_ode_5Joint_stop_cfm, __pyx_setprop_4_ode_5Joint_stop_cfm, 0, 0},
  {"suspension_erp", __pyx_getprop_4_ode_5Joint_suspension_erp, __pyx_setprop_4_ode_5Joint_suspension_erp, 0, 0},
  {"suspension_cfm", __pyx_getprop_4_ode_5Joint_suspension_cfm, __pyx_setprop_4_ode_5Joint_suspension_cfm, 0, 0},
  {"lo_stop2", __pyx_getprop_4_ode_5Joint_lo_stop2, __pyx_setprop_4_ode_5Joint_lo_stop2, 0, 0},
  {"hi_stop2", __pyx_getprop_4_ode_5Joint_hi_stop2, __pyx_setprop_4_ode_5Joint_hi_stop2, 0, 0},
  {"velocity2", __pyx_getprop_4_ode_5Joint_velocity2, __pyx_setprop_4_ode_5Joint_velocity2, 0, 0},
  {"fmax2", __pyx_getprop_4_ode_5Joint_fmax2, __pyx_setprop_4_ode_5Joint_fmax2, 0, 0},
  {"fudge_factor2", __pyx_getprop_4_ode_5Joint_fudge_factor2, __pyx_setprop_4_ode_5Joint_fudge_factor2, 0, 0},
  {"bounce2", __pyx_getprop_4_ode_5Joint_bounce2, __pyx_setprop_4_ode_5Joint_bounce2, 0, 0},
  {"cfm2", __pyx_getprop_4_ode_5Joint_cfm2, __pyx_setprop_4_ode_5Joint_cfm2, 0, 0},
  {"stop_erp2", __pyx_getprop_4_ode_5Joint_stop_erp2, __pyx_setprop_4_ode_5Joint_stop_erp2, 0, 0},
  {"stop_cfm2", __pyx_getprop_4_ode_5Joint_stop_cfm2, __pyx_setprop_4_ode_5Joint_stop_cfm2, 0, 0},
  {"suspension_erp2", __pyx_getprop_4_ode_5Joint_suspension_erp2, __pyx_setprop_4_ode_5Joint_suspension_erp2, 0, 0},
  {"suspension_cfm2", __pyx_getprop_4_ode_5Joint_suspension_cfm2, __pyx_setprop_4_ode_5Joint_suspension_cfm2, 0, 0},
  {0, 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_4_ode_Joint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.Joint", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_Joint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_Joint, /*tp_traverse*/
  __pyx_tp_clear_4_ode_Joint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_Joint, /*tp_methods*/
  __pyx_members_4_ode_Joint, /*tp_members*/
  __pyx_getsets_4_ode_Joint, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_4_ode_5Joint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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_4_ode_JointGroup(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  struct __pyx_obj_4_ode_JointGroup *p = (struct __pyx_obj_4_ode_JointGroup *)o;
  p->jointlist = Py_None; Py_INCREF(p->jointlist);
  if (__pyx_f_4_ode_10JointGroup___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_JointGroup(PyObject *o) {
  struct __pyx_obj_4_ode_JointGroup *p = (struct __pyx_obj_4_ode_JointGroup *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_4_ode_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_4_ode_JointGroup(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4_ode_JointGroup *p = (struct __pyx_obj_4_ode_JointGroup *)o;
  if (p->jointlist) {
    e = (*v)(p->jointlist, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4_ode_JointGroup(PyObject *o) {
  struct __pyx_obj_4_ode_JointGroup *p = (struct __pyx_obj_4_ode_JointGroup *)o;
  Py_XDECREF(p->jointlist);
  p->jointlist = Py_None; Py_INCREF(p->jointlist);
  return 0;
}

static struct PyMethodDef __pyx_methods_4_ode_JointGroup[] = {
  {"empty", (PyCFunction)__pyx_f_4_ode_10JointGroup_empty, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_10JointGroup_empty},
  {"_addjoint", (PyCFunction)__pyx_f_4_ode_10JointGroup__addjoint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_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_4_ode_JointGroup = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.JointGroup", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_JointGroup), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_JointGroup, /*tp_traverse*/
  __pyx_tp_clear_4_ode_JointGroup, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_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_4_ode_10JointGroup___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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 struct __pyx_vtabstruct_4_ode_BallJoint __pyx_vtable_4_ode_BallJoint;

static PyObject *__pyx_tp_new_4_ode_BallJoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_Joint->tp_new(t, a, k);
  struct __pyx_obj_4_ode_BallJoint *p = (struct __pyx_obj_4_ode_BallJoint *)o;
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_BallJoint *)__pyx_vtabptr_4_ode_BallJoint;
  if (__pyx_f_4_ode_9BallJoint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_BallJoint(PyObject *o) {
  struct __pyx_obj_4_ode_BallJoint *p = (struct __pyx_obj_4_ode_BallJoint *)o;
  __pyx_ptype_4_ode_Joint->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_BallJoint(PyObject *o) {
  struct __pyx_obj_4_ode_BallJoint *p = (struct __pyx_obj_4_ode_BallJoint *)o;
  __pyx_ptype_4_ode_Joint->tp_clear(o);
  return 0;
}

static PyObject *__pyx_getprop_4_ode_9BallJoint_anchor(PyObject *o, void *x) {
  return __pyx_f_4_ode_9BallJoint_6anchor___get__(o);
}

static int __pyx_setprop_4_ode_9BallJoint_anchor(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_9BallJoint_6anchor___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_9BallJoint_anchor2(PyObject *o, void *x) {
  return __pyx_f_4_ode_9BallJoint_7anchor2___get__(o);
}

static struct PyMethodDef __pyx_methods_4_ode_BallJoint[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode_BallJoint[] = {
  {"anchor", __pyx_getprop_4_ode_9BallJoint_anchor, __pyx_setprop_4_ode_9BallJoint_anchor, __pyx_k17, 0},
  {"anchor2", __pyx_getprop_4_ode_9BallJoint_anchor2, 0, __pyx_k18, 0},
  {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_4_ode_BallJoint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.BallJoint", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_BallJoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_BallJoint, /*tp_traverse*/
  __pyx_tp_clear_4_ode_BallJoint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_BallJoint, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4_ode_BallJoint, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_4_ode_9BallJoint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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 struct __pyx_vtabstruct_4_ode_HingeJoint __pyx_vtable_4_ode_HingeJoint;

static PyObject *__pyx_tp_new_4_ode_HingeJoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_Joint->tp_new(t, a, k);
  struct __pyx_obj_4_ode_HingeJoint *p = (struct __pyx_obj_4_ode_HingeJoint *)o;
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_HingeJoint *)__pyx_vtabptr_4_ode_HingeJoint;
  if (__pyx_f_4_ode_10HingeJoint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_HingeJoint(PyObject *o) {
  struct __pyx_obj_4_ode_HingeJoint *p = (struct __pyx_obj_4_ode_HingeJoint *)o;
  __pyx_ptype_4_ode_Joint->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_HingeJoint(PyObject *o) {
  struct __pyx_obj_4_ode_HingeJoint *p = (struct __pyx_obj_4_ode_HingeJoint *)o;
  __pyx_ptype_4_ode_Joint->tp_clear(o);
  return 0;
}

static PyObject *__pyx_getprop_4_ode_10HingeJoint_anchor(PyObject *o, void *x) {
  return __pyx_f_4_ode_10HingeJoint_6anchor___get__(o);
}

static int __pyx_setprop_4_ode_10HingeJoint_anchor(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_10HingeJoint_6anchor___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_10HingeJoint_anchor2(PyObject *o, void *x) {
  return __pyx_f_4_ode_10HingeJoint_7anchor2___get__(o);
}

static PyObject *__pyx_getprop_4_ode_10HingeJoint_axis(PyObject *o, void *x) {
  return __pyx_f_4_ode_10HingeJoint_4axis___get__(o);
}

static int __pyx_setprop_4_ode_10HingeJoint_axis(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_10HingeJoint_4axis___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_10HingeJoint_angle(PyObject *o, void *x) {
  return __pyx_f_4_ode_10HingeJoint_5angle___get__(o);
}

static PyObject *__pyx_getprop_4_ode_10HingeJoint_angle_rate(PyObject *o, void *x) {
  return __pyx_f_4_ode_10HingeJoint_10angle_rate___get__(o);
}

static struct PyMethodDef __pyx_methods_4_ode_HingeJoint[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode_HingeJoint[] = {
  {"anchor", __pyx_getprop_4_ode_10HingeJoint_anchor, __pyx_setprop_4_ode_10HingeJoint_anchor, __pyx_k19, 0},
  {"anchor2", __pyx_getprop_4_ode_10HingeJoint_anchor2, 0, __pyx_k20, 0},
  {"axis", __pyx_getprop_4_ode_10HingeJoint_axis, __pyx_setprop_4_ode_10HingeJoint_axis, __pyx_k21, 0},
  {"angle", __pyx_getprop_4_ode_10HingeJoint_angle, 0, __pyx_k22, 0},
  {"angle_rate", __pyx_getprop_4_ode_10HingeJoint_angle_rate, 0, __pyx_k23, 0},
  {0, 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_4_ode_HingeJoint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.HingeJoint", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_HingeJoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_HingeJoint, /*tp_traverse*/
  __pyx_tp_clear_4_ode_HingeJoint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_HingeJoint, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4_ode_HingeJoint, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_4_ode_10HingeJoint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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 struct __pyx_vtabstruct_4_ode_SliderJoint __pyx_vtable_4_ode_SliderJoint;

static PyObject *__pyx_tp_new_4_ode_SliderJoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_Joint->tp_new(t, a, k);
  struct __pyx_obj_4_ode_SliderJoint *p = (struct __pyx_obj_4_ode_SliderJoint *)o;
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_SliderJoint *)__pyx_vtabptr_4_ode_SliderJoint;
  if (__pyx_f_4_ode_11SliderJoint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_SliderJoint(PyObject *o) {
  struct __pyx_obj_4_ode_SliderJoint *p = (struct __pyx_obj_4_ode_SliderJoint *)o;
  __pyx_ptype_4_ode_Joint->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_SliderJoint(PyObject *o) {
  struct __pyx_obj_4_ode_SliderJoint *p = (struct __pyx_obj_4_ode_SliderJoint *)o;
  __pyx_ptype_4_ode_Joint->tp_clear(o);
  return 0;
}

static PyObject *__pyx_getprop_4_ode_11SliderJoint_axis(PyObject *o, void *x) {
  return __pyx_f_4_ode_11SliderJoint_4axis___get__(o);
}

static int __pyx_setprop_4_ode_11SliderJoint_axis(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_11SliderJoint_4axis___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_11SliderJoint_position(PyObject *o, void *x) {
  return __pyx_f_4_ode_11SliderJoint_8position___get__(o);
}

static PyObject *__pyx_getprop_4_ode_11SliderJoint_position_rate(PyObject *o, void *x) {
  return __pyx_f_4_ode_11SliderJoint_13position_rate___get__(o);
}

static struct PyMethodDef __pyx_methods_4_ode_SliderJoint[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode_SliderJoint[] = {
  {"axis", __pyx_getprop_4_ode_11SliderJoint_axis, __pyx_setprop_4_ode_11SliderJoint_axis, __pyx_k24, 0},
  {"position", __pyx_getprop_4_ode_11SliderJoint_position, 0, __pyx_k25, 0},
  {"position_rate", __pyx_getprop_4_ode_11SliderJoint_position_rate, 0, __pyx_k26, 0},
  {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_4_ode_SliderJoint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.SliderJoint", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_SliderJoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_SliderJoint, /*tp_traverse*/
  __pyx_tp_clear_4_ode_SliderJoint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_SliderJoint, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4_ode_SliderJoint, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_4_ode_11SliderJoint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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 struct __pyx_vtabstruct_4_ode_UniversalJoint __pyx_vtable_4_ode_UniversalJoint;

static PyObject *__pyx_tp_new_4_ode_UniversalJoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_Joint->tp_new(t, a, k);
  struct __pyx_obj_4_ode_UniversalJoint *p = (struct __pyx_obj_4_ode_UniversalJoint *)o;
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_UniversalJoint *)__pyx_vtabptr_4_ode_UniversalJoint;
  if (__pyx_f_4_ode_14UniversalJoint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_UniversalJoint(PyObject *o) {
  struct __pyx_obj_4_ode_UniversalJoint *p = (struct __pyx_obj_4_ode_UniversalJoint *)o;
  __pyx_ptype_4_ode_Joint->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_UniversalJoint(PyObject *o) {
  struct __pyx_obj_4_ode_UniversalJoint *p = (struct __pyx_obj_4_ode_UniversalJoint *)o;
  __pyx_ptype_4_ode_Joint->tp_clear(o);
  return 0;
}

static PyObject *__pyx_getprop_4_ode_14UniversalJoint_anchor(PyObject *o, void *x) {
  return __pyx_f_4_ode_14UniversalJoint_6anchor___get__(o);
}

static int __pyx_setprop_4_ode_14UniversalJoint_anchor(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_14UniversalJoint_6anchor___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_14UniversalJoint_anchor2(PyObject *o, void *x) {
  return __pyx_f_4_ode_14UniversalJoint_7anchor2___get__(o);
}

static PyObject *__pyx_getprop_4_ode_14UniversalJoint_axis1(PyObject *o, void *x) {
  return __pyx_f_4_ode_14UniversalJoint_5axis1___get__(o);
}

static int __pyx_setprop_4_ode_14UniversalJoint_axis1(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_14UniversalJoint_5axis1___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_14UniversalJoint_axis2(PyObject *o, void *x) {
  return __pyx_f_4_ode_14UniversalJoint_5axis2___get__(o);
}

static int __pyx_setprop_4_ode_14UniversalJoint_axis2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_14UniversalJoint_5axis2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static struct PyMethodDef __pyx_methods_4_ode_UniversalJoint[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode_UniversalJoint[] = {
  {"anchor", __pyx_getprop_4_ode_14UniversalJoint_anchor, __pyx_setprop_4_ode_14UniversalJoint_anchor, __pyx_k19, 0},
  {"anchor2", __pyx_getprop_4_ode_14UniversalJoint_anchor2, 0, __pyx_k20, 0},
  {"axis1", __pyx_getprop_4_ode_14UniversalJoint_axis1, __pyx_setprop_4_ode_14UniversalJoint_axis1, __pyx_k27, 0},
  {"axis2", __pyx_getprop_4_ode_14UniversalJoint_axis2, __pyx_setprop_4_ode_14UniversalJoint_axis2, __pyx_k28, 0},
  {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_4_ode_UniversalJoint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.UniversalJoint", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_UniversalJoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_UniversalJoint, /*tp_traverse*/
  __pyx_tp_clear_4_ode_UniversalJoint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_UniversalJoint, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4_ode_UniversalJoint, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_4_ode_14UniversalJoint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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 struct __pyx_vtabstruct_4_ode_Hinge2Joint __pyx_vtable_4_ode_Hinge2Joint;

static PyObject *__pyx_tp_new_4_ode_Hinge2Joint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_Joint->tp_new(t, a, k);
  struct __pyx_obj_4_ode_Hinge2Joint *p = (struct __pyx_obj_4_ode_Hinge2Joint *)o;
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_Hinge2Joint *)__pyx_vtabptr_4_ode_Hinge2Joint;
  if (__pyx_f_4_ode_11Hinge2Joint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_Hinge2Joint(PyObject *o) {
  struct __pyx_obj_4_ode_Hinge2Joint *p = (struct __pyx_obj_4_ode_Hinge2Joint *)o;
  __pyx_ptype_4_ode_Joint->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_Hinge2Joint(PyObject *o) {
  struct __pyx_obj_4_ode_Hinge2Joint *p = (struct __pyx_obj_4_ode_Hinge2Joint *)o;
  __pyx_ptype_4_ode_Joint->tp_clear(o);
  return 0;
}

static PyObject *__pyx_getprop_4_ode_11Hinge2Joint_anchor(PyObject *o, void *x) {
  return __pyx_f_4_ode_11Hinge2Joint_6anchor___get__(o);
}

static int __pyx_setprop_4_ode_11Hinge2Joint_anchor(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_11Hinge2Joint_6anchor___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_11Hinge2Joint_anchor2(PyObject *o, void *x) {
  return __pyx_f_4_ode_11Hinge2Joint_7anchor2___get__(o);
}

static PyObject *__pyx_getprop_4_ode_11Hinge2Joint_axis1(PyObject *o, void *x) {
  return __pyx_f_4_ode_11Hinge2Joint_5axis1___get__(o);
}

static int __pyx_setprop_4_ode_11Hinge2Joint_axis1(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_11Hinge2Joint_5axis1___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_11Hinge2Joint_axis2(PyObject *o, void *x) {
  return __pyx_f_4_ode_11Hinge2Joint_5axis2___get__(o);
}

static int __pyx_setprop_4_ode_11Hinge2Joint_axis2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_11Hinge2Joint_5axis2___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4_ode_11Hinge2Joint_angle1(PyObject *o, void *x) {
  return __pyx_f_4_ode_11Hinge2Joint_6angle1___get__(o);
}

static PyObject *__pyx_getprop_4_ode_11Hinge2Joint_angle1_rate(PyObject *o, void *x) {
  return __pyx_f_4_ode_11Hinge2Joint_11angle1_rate___get__(o);
}

static PyObject *__pyx_getprop_4_ode_11Hinge2Joint_angle2_rate(PyObject *o, void *x) {
  return __pyx_f_4_ode_11Hinge2Joint_11angle2_rate___get__(o);
}

static struct PyMethodDef __pyx_methods_4_ode_Hinge2Joint[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode_Hinge2Joint[] = {
  {"anchor", __pyx_getprop_4_ode_11Hinge2Joint_anchor, __pyx_setprop_4_ode_11Hinge2Joint_anchor, __pyx_k19, 0},
  {"anchor2", __pyx_getprop_4_ode_11Hinge2Joint_anchor2, 0, __pyx_k20, 0},
  {"axis1", __pyx_getprop_4_ode_11Hinge2Joint_axis1, __pyx_setprop_4_ode_11Hinge2Joint_axis1, __pyx_k27, 0},
  {"axis2", __pyx_getprop_4_ode_11Hinge2Joint_axis2, __pyx_setprop_4_ode_11Hinge2Joint_axis2, __pyx_k28, 0},
  {"angle1", __pyx_getprop_4_ode_11Hinge2Joint_angle1, 0, __pyx_k29, 0},
  {"angle1_rate", __pyx_getprop_4_ode_11Hinge2Joint_angle1_rate, 0, __pyx_k30, 0},
  {"angle2_rate", __pyx_getprop_4_ode_11Hinge2Joint_angle2_rate, 0, __pyx_k31, 0},
  {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_4_ode_Hinge2Joint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.Hinge2Joint", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_Hinge2Joint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_Hinge2Joint, /*tp_traverse*/
  __pyx_tp_clear_4_ode_Hinge2Joint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_Hinge2Joint, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4_ode_Hinge2Joint, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_4_ode_11Hinge2Joint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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 struct __pyx_vtabstruct_4_ode_FixedJoint __pyx_vtable_4_ode_FixedJoint;

static PyObject *__pyx_tp_new_4_ode_FixedJoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_Joint->tp_new(t, a, k);
  struct __pyx_obj_4_ode_FixedJoint *p = (struct __pyx_obj_4_ode_FixedJoint *)o;
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_FixedJoint *)__pyx_vtabptr_4_ode_FixedJoint;
  if (__pyx_f_4_ode_10FixedJoint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_FixedJoint(PyObject *o) {
  struct __pyx_obj_4_ode_FixedJoint *p = (struct __pyx_obj_4_ode_FixedJoint *)o;
  __pyx_ptype_4_ode_Joint->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_FixedJoint(PyObject *o) {
  struct __pyx_obj_4_ode_FixedJoint *p = (struct __pyx_obj_4_ode_FixedJoint *)o;
  __pyx_ptype_4_ode_Joint->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_4_ode_FixedJoint[] = {
  {"setFixed", (PyCFunction)__pyx_f_4_ode_10FixedJoint_setFixed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_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_4_ode_FixedJoint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.FixedJoint", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_FixedJoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_FixedJoint, /*tp_traverse*/
  __pyx_tp_clear_4_ode_FixedJoint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_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_4_ode_10FixedJoint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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 struct __pyx_vtabstruct_4_ode_ContactJoint __pyx_vtable_4_ode_ContactJoint;

static PyObject *__pyx_tp_new_4_ode_ContactJoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_Joint->tp_new(t, a, k);
  struct __pyx_obj_4_ode_ContactJoint *p = (struct __pyx_obj_4_ode_ContactJoint *)o;
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_ContactJoint *)__pyx_vtabptr_4_ode_ContactJoint;
  if (__pyx_f_4_ode_12ContactJoint___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_ContactJoint(PyObject *o) {
  struct __pyx_obj_4_ode_ContactJoint *p = (struct __pyx_obj_4_ode_ContactJoint *)o;
  __pyx_ptype_4_ode_Joint->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_ContactJoint(PyObject *o) {
  struct __pyx_obj_4_ode_ContactJoint *p = (struct __pyx_obj_4_ode_ContactJoint *)o;
  __pyx_ptype_4_ode_Joint->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_4_ode_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_4_ode_ContactJoint = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.ContactJoint", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_ContactJoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_ContactJoint, /*tp_traverse*/
  __pyx_tp_clear_4_ode_ContactJoint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_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_4_ode_12ContactJoint___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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 struct __pyx_vtabstruct_4_ode_AMotor __pyx_vtable_4_ode_AMotor;

static PyObject *__pyx_tp_new_4_ode_AMotor(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_Joint->tp_new(t, a, k);
  struct __pyx_obj_4_ode_AMotor *p = (struct __pyx_obj_4_ode_AMotor *)o;
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_AMotor *)__pyx_vtabptr_4_ode_AMotor;
  if (__pyx_f_4_ode_6AMotor___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_AMotor(PyObject *o) {
  struct __pyx_obj_4_ode_AMotor *p = (struct __pyx_obj_4_ode_AMotor *)o;
  __pyx_ptype_4_ode_Joint->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_AMotor(PyObject *o) {
  struct __pyx_obj_4_ode_AMotor *p = (struct __pyx_obj_4_ode_AMotor *)o;
  __pyx_ptype_4_ode_Joint->tp_clear(o);
  return 0;
}

static PyObject *__pyx_getprop_4_ode_6AMotor_mode(PyObject *o, void *x) {
  return __pyx_f_4_ode_6AMotor_4mode___get__(o);
}

static int __pyx_setprop_4_ode_6AMotor_mode(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_6AMotor_4mode___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static struct PyMethodDef __pyx_methods_4_ode_AMotor[] = {
  {"setNumAxes", (PyCFunction)__pyx_f_4_ode_6AMotor_setNumAxes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_6AMotor_setNumAxes},
  {"getNumAxes", (PyCFunction)__pyx_f_4_ode_6AMotor_getNumAxes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_6AMotor_getNumAxes},
  {"setAxis", (PyCFunction)__pyx_f_4_ode_6AMotor_setAxis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_6AMotor_setAxis},
  {"getAxis", (PyCFunction)__pyx_f_4_ode_6AMotor_getAxis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_6AMotor_getAxis},
  {"getAxisRel", (PyCFunction)__pyx_f_4_ode_6AMotor_getAxisRel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_6AMotor_getAxisRel},
  {"setAngle", (PyCFunction)__pyx_f_4_ode_6AMotor_setAngle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_6AMotor_setAngle},
  {"getAngle", (PyCFunction)__pyx_f_4_ode_6AMotor_getAngle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_6AMotor_getAngle},
  {"getAngleRate", (PyCFunction)__pyx_f_4_ode_6AMotor_getAngleRate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_6AMotor_getAngleRate},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode_AMotor[] = {
  {"mode", __pyx_getprop_4_ode_6AMotor_mode, __pyx_setprop_4_ode_6AMotor_mode, __pyx_k32, 0},
  {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_4_ode_AMotor = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.AMotor", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_AMotor), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_AMotor, /*tp_traverse*/
  __pyx_tp_clear_4_ode_AMotor, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_AMotor, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4_ode_AMotor, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_4_ode_6AMotor___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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 struct __pyx_vtabstruct_4_ode_SpaceBase __pyx_vtable_4_ode_SpaceBase;

static PyObject *__pyx_tp_new_4_ode_SpaceBase(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_GeomObject->tp_new(t, a, k);
  struct __pyx_obj_4_ode_SpaceBase *p = (struct __pyx_obj_4_ode_SpaceBase *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_SpaceBase *)__pyx_vtabptr_4_ode_SpaceBase;
  p->geoms = Py_None; Py_INCREF(p->geoms);
  if (__pyx_f_4_ode_9SpaceBase___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_SpaceBase(PyObject *o) {
  struct __pyx_obj_4_ode_SpaceBase *p = (struct __pyx_obj_4_ode_SpaceBase *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_4_ode_9SpaceBase___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(p->geoms);
  __pyx_ptype_4_ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_4_ode_SpaceBase(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4_ode_SpaceBase *p = (struct __pyx_obj_4_ode_SpaceBase *)o;
  __pyx_ptype_4_ode_GeomObject->tp_traverse(o, v, a);
  if (p->geoms) {
    e = (*v)(p->geoms, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4_ode_SpaceBase(PyObject *o) {
  struct __pyx_obj_4_ode_SpaceBase *p = (struct __pyx_obj_4_ode_SpaceBase *)o;
  __pyx_ptype_4_ode_GeomObject->tp_clear(o);
  Py_XDECREF(p->geoms);
  p->geoms = Py_None; Py_INCREF(p->geoms);
  return 0;
}

static struct PyMethodDef __pyx_methods_4_ode_SpaceBase[] = {
  {"add", (PyCFunction)__pyx_f_4_ode_9SpaceBase_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_9SpaceBase_add},
  {"remove", (PyCFunction)__pyx_f_4_ode_9SpaceBase_remove, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_9SpaceBase_remove},
  {"set_last_transformations", (PyCFunction)__pyx_f_4_ode_9SpaceBase_set_last_transformations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_9SpaceBase_set_last_transformations},
  {"query", (PyCFunction)__pyx_f_4_ode_9SpaceBase_query, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_9SpaceBase_query},
  {"getNumGeoms", (PyCFunction)__pyx_f_4_ode_9SpaceBase_getNumGeoms, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_9SpaceBase_getNumGeoms},
  {"getGeom", (PyCFunction)__pyx_f_4_ode_9SpaceBase_getGeom, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_9SpaceBase_getGeom},
  {"placeable", (PyCFunction)__pyx_f_4_ode_9SpaceBase_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {"collide", (PyCFunction)__pyx_f_4_ode_9SpaceBase_collide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_9SpaceBase_collide},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4_ode_SpaceBase[] = {
  {"geoms", T_OBJECT, offsetof(struct __pyx_obj_4_ode_SpaceBase, geoms), READONLY, 0},
  {0, 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_4_ode_SpaceBase = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.SpaceBase", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_SpaceBase), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_SpaceBase, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_SpaceBase, /*tp_as_number*/
  &__pyx_tp_as_sequence_SpaceBase, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_SpaceBase, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_SpaceBase, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Space class (container for geometry objects).\n\n		A Space object is a container for geometry objects which are used\n		to do collision detection.\n		The space does high level collision culling, which means that it\n		can identify which pairs of geometry objects are potentially\n		touching.\n\n		This Space class can be used for both, a SimpleSpace and a HashSpace\n		(see ODE documentation).\n\n		 >>> space = Space(type=0)   # Create a SimpleSpace\n		 >>> space = Space(type=1)   # Create a HashSpace\n		", /*tp_doc*/
  __pyx_tp_traverse_4_ode_SpaceBase, /*tp_traverse*/
  __pyx_tp_clear_4_ode_SpaceBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_SpaceBase, /*tp_methods*/
  __pyx_members_4_ode_SpaceBase, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_4_ode_9SpaceBase___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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 struct __pyx_vtabstruct_4_ode__TriMesh __pyx_vtable_4_ode__TriMesh;

static PyObject *__pyx_tp_new_4_ode__TriMesh(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_GeomObject->tp_new(t, a, k);
  struct __pyx_obj_4_ode__TriMesh *p = (struct __pyx_obj_4_ode__TriMesh *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode__TriMesh *)__pyx_vtabptr_4_ode__TriMesh;
  if (__pyx_f_4_ode_8_TriMesh___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode__TriMesh(PyObject *o) {
  struct __pyx_obj_4_ode__TriMesh *p = (struct __pyx_obj_4_ode__TriMesh *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_4_ode_8_TriMesh___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_ptype_4_ode_GeomObject->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode__TriMesh(PyObject *o) {
  struct __pyx_obj_4_ode__TriMesh *p = (struct __pyx_obj_4_ode__TriMesh *)o;
  __pyx_ptype_4_ode_GeomObject->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_4_ode__TriMesh[] = {
  {0, 0, 0, 0}
};

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

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

statichere PyTypeObject __pyx_type_4_ode__TriMesh = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode._TriMesh", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode__TriMesh), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode__TriMesh, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number__TriMesh, /*tp_as_number*/
  &__pyx_tp_as_sequence__TriMesh, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__TriMesh, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__TriMesh, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Parent class for all TriMesh-derived geoms.\n		TriMesh-TriMesh collison does not currently return meaningful normals\n		or depth, so don\'t try to use it for collision response!", /*tp_doc*/
  __pyx_tp_traverse_4_ode__TriMesh, /*tp_traverse*/
  __pyx_tp_clear_4_ode__TriMesh, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode__TriMesh, /*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_4_ode__TriMesh, /*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 __pyx_vtabstruct_4_ode_SimpleSpace __pyx_vtable_4_ode_SimpleSpace;

static PyObject *__pyx_tp_new_4_ode_SimpleSpace(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_SpaceBase->tp_new(t, a, k);
  struct __pyx_obj_4_ode_SimpleSpace *p = (struct __pyx_obj_4_ode_SimpleSpace *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_SimpleSpace *)__pyx_vtabptr_4_ode_SimpleSpace;
  return o;
}

static void __pyx_tp_dealloc_4_ode_SimpleSpace(PyObject *o) {
  struct __pyx_obj_4_ode_SimpleSpace *p = (struct __pyx_obj_4_ode_SimpleSpace *)o;
  __pyx_ptype_4_ode_SpaceBase->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_SimpleSpace(PyObject *o) {
  struct __pyx_obj_4_ode_SimpleSpace *p = (struct __pyx_obj_4_ode_SimpleSpace *)o;
  __pyx_ptype_4_ode_SpaceBase->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_4_ode_SimpleSpace[] = {
  {"_create", (PyCFunction)__pyx_f_4_ode_11SimpleSpace__create, METH_VARARGS|METH_KEYWORDS, 0},
  {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_4_ode_SimpleSpace = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.SimpleSpace", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_SimpleSpace), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_SimpleSpace, /*tp_traverse*/
  __pyx_tp_clear_4_ode_SimpleSpace, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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 struct __pyx_vtabstruct_4_ode_HashSpace __pyx_vtable_4_ode_HashSpace;

static PyObject *__pyx_tp_new_4_ode_HashSpace(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_SpaceBase->tp_new(t, a, k);
  struct __pyx_obj_4_ode_HashSpace *p = (struct __pyx_obj_4_ode_HashSpace *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_HashSpace *)__pyx_vtabptr_4_ode_HashSpace;
  return o;
}

static void __pyx_tp_dealloc_4_ode_HashSpace(PyObject *o) {
  struct __pyx_obj_4_ode_HashSpace *p = (struct __pyx_obj_4_ode_HashSpace *)o;
  __pyx_ptype_4_ode_SpaceBase->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_HashSpace(PyObject *o) {
  struct __pyx_obj_4_ode_HashSpace *p = (struct __pyx_obj_4_ode_HashSpace *)o;
  __pyx_ptype_4_ode_SpaceBase->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_4_ode_HashSpace[] = {
  {"_create", (PyCFunction)__pyx_f_4_ode_9HashSpace__create, METH_VARARGS|METH_KEYWORDS, 0},
  {"setLevels", (PyCFunction)__pyx_f_4_ode_9HashSpace_setLevels, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_9HashSpace_setLevels},
  {"getLevels", (PyCFunction)__pyx_f_4_ode_9HashSpace_getLevels, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_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_4_ode_HashSpace = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.HashSpace", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_HashSpace), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_HashSpace, /*tp_traverse*/
  __pyx_tp_clear_4_ode_HashSpace, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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 struct __pyx_vtabstruct_4_ode_GeomSphere __pyx_vtable_4_ode_GeomSphere;

static PyObject *__pyx_tp_new_4_ode_GeomSphere(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_GeomObject->tp_new(t, a, k);
  struct __pyx_obj_4_ode_GeomSphere *p = (struct __pyx_obj_4_ode_GeomSphere *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_GeomSphere *)__pyx_vtabptr_4_ode_GeomSphere;
  if (__pyx_f_4_ode_10GeomSphere___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_GeomSphere(PyObject *o) {
  struct __pyx_obj_4_ode_GeomSphere *p = (struct __pyx_obj_4_ode_GeomSphere *)o;
  __pyx_ptype_4_ode_GeomObject->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_GeomSphere(PyObject *o) {
  struct __pyx_obj_4_ode_GeomSphere *p = (struct __pyx_obj_4_ode_GeomSphere *)o;
  __pyx_ptype_4_ode_GeomObject->tp_clear(o);
  return 0;
}

static PyObject *__pyx_getprop_4_ode_10GeomSphere_radius(PyObject *o, void *x) {
  return __pyx_f_4_ode_10GeomSphere_6radius___get__(o);
}

static int __pyx_setprop_4_ode_10GeomSphere_radius(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_10GeomSphere_6radius___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static struct PyMethodDef __pyx_methods_4_ode_GeomSphere[] = {
  {"placeable", (PyCFunction)__pyx_f_4_ode_10GeomSphere_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode_GeomSphere[] = {
  {"radius", __pyx_getprop_4_ode_10GeomSphere_radius, __pyx_setprop_4_ode_10GeomSphere_radius, 0, 0},
  {0, 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_4_ode_GeomSphere = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.GeomSphere", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_GeomSphere), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_GeomSphere, /*tp_traverse*/
  __pyx_tp_clear_4_ode_GeomSphere, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_GeomSphere, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4_ode_GeomSphere, /*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_4_ode_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 struct __pyx_vtabstruct_4_ode_GeomBox __pyx_vtable_4_ode_GeomBox;

static PyObject *__pyx_tp_new_4_ode_GeomBox(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_GeomObject->tp_new(t, a, k);
  struct __pyx_obj_4_ode_GeomBox *p = (struct __pyx_obj_4_ode_GeomBox *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_GeomBox *)__pyx_vtabptr_4_ode_GeomBox;
  if (__pyx_f_4_ode_7GeomBox___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_GeomBox(PyObject *o) {
  struct __pyx_obj_4_ode_GeomBox *p = (struct __pyx_obj_4_ode_GeomBox *)o;
  __pyx_ptype_4_ode_GeomObject->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_GeomBox(PyObject *o) {
  struct __pyx_obj_4_ode_GeomBox *p = (struct __pyx_obj_4_ode_GeomBox *)o;
  __pyx_ptype_4_ode_GeomObject->tp_clear(o);
  return 0;
}

static struct PyMethodDef __pyx_methods_4_ode_GeomBox[] = {
  {"placeable", (PyCFunction)__pyx_f_4_ode_7GeomBox_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {"setLengths", (PyCFunction)__pyx_f_4_ode_7GeomBox_setLengths, METH_VARARGS|METH_KEYWORDS, 0},
  {"getLengths", (PyCFunction)__pyx_f_4_ode_7GeomBox_getLengths, METH_VARARGS|METH_KEYWORDS, 0},
  {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_4_ode_GeomBox = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.GeomBox", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_GeomBox), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_GeomBox, /*tp_traverse*/
  __pyx_tp_clear_4_ode_GeomBox, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode_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 struct __pyx_vtabstruct_4_ode_GeomPlane __pyx_vtable_4_ode_GeomPlane;

static PyObject *__pyx_tp_new_4_ode_GeomPlane(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_GeomObject->tp_new(t, a, k);
  struct __pyx_obj_4_ode_GeomPlane *p = (struct __pyx_obj_4_ode_GeomPlane *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_GeomPlane *)__pyx_vtabptr_4_ode_GeomPlane;
  if (__pyx_f_4_ode_9GeomPlane___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_GeomPlane(PyObject *o) {
  struct __pyx_obj_4_ode_GeomPlane *p = (struct __pyx_obj_4_ode_GeomPlane *)o;
  __pyx_ptype_4_ode_GeomObject->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_GeomPlane(PyObject *o) {
  struct __pyx_obj_4_ode_GeomPlane *p = (struct __pyx_obj_4_ode_GeomPlane *)o;
  __pyx_ptype_4_ode_GeomObject->tp_clear(o);
  return 0;
}

static PyObject *__pyx_getprop_4_ode_9GeomPlane_params(PyObject *o, void *x) {
  return __pyx_f_4_ode_9GeomPlane_6params___get__(o);
}

static int __pyx_setprop_4_ode_9GeomPlane_params(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_9GeomPlane_6params___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static struct PyMethodDef __pyx_methods_4_ode_GeomPlane[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode_GeomPlane[] = {
  {"params", __pyx_getprop_4_ode_9GeomPlane_params, __pyx_setprop_4_ode_9GeomPlane_params, 0, 0},
  {0, 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_4_ode_GeomPlane = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.GeomPlane", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_GeomPlane), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_GeomPlane, /*tp_traverse*/
  __pyx_tp_clear_4_ode_GeomPlane, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_GeomPlane, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4_ode_GeomPlane, /*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_4_ode_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 struct __pyx_vtabstruct_4_ode_GeomCCylinder __pyx_vtable_4_ode_GeomCCylinder;

static PyObject *__pyx_tp_new_4_ode_GeomCCylinder(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_GeomObject->tp_new(t, a, k);
  struct __pyx_obj_4_ode_GeomCCylinder *p = (struct __pyx_obj_4_ode_GeomCCylinder *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_GeomCCylinder *)__pyx_vtabptr_4_ode_GeomCCylinder;
  if (__pyx_f_4_ode_13GeomCCylinder___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_GeomCCylinder(PyObject *o) {
  struct __pyx_obj_4_ode_GeomCCylinder *p = (struct __pyx_obj_4_ode_GeomCCylinder *)o;
  __pyx_ptype_4_ode_GeomObject->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_GeomCCylinder(PyObject *o) {
  struct __pyx_obj_4_ode_GeomCCylinder *p = (struct __pyx_obj_4_ode_GeomCCylinder *)o;
  __pyx_ptype_4_ode_GeomObject->tp_clear(o);
  return 0;
}

static PyObject *__pyx_getprop_4_ode_13GeomCCylinder_params(PyObject *o, void *x) {
  return __pyx_f_4_ode_13GeomCCylinder_6params___get__(o);
}

static int __pyx_setprop_4_ode_13GeomCCylinder_params(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_13GeomCCylinder_6params___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static struct PyMethodDef __pyx_methods_4_ode_GeomCCylinder[] = {
  {"placeable", (PyCFunction)__pyx_f_4_ode_13GeomCCylinder_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode_GeomCCylinder[] = {
  {"params", __pyx_getprop_4_ode_13GeomCCylinder_params, __pyx_setprop_4_ode_13GeomCCylinder_params, 0, 0},
  {0, 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_4_ode_GeomCCylinder = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.GeomCCylinder", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_GeomCCylinder), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_GeomCCylinder, /*tp_traverse*/
  __pyx_tp_clear_4_ode_GeomCCylinder, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_GeomCCylinder, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4_ode_GeomCCylinder, /*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_4_ode_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 struct __pyx_vtabstruct_4_ode_GeomRay __pyx_vtable_4_ode_GeomRay;

static PyObject *__pyx_tp_new_4_ode_GeomRay(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_GeomObject->tp_new(t, a, k);
  struct __pyx_obj_4_ode_GeomRay *p = (struct __pyx_obj_4_ode_GeomRay *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode_GeomRay *)__pyx_vtabptr_4_ode_GeomRay;
  if (__pyx_f_4_ode_7GeomRay___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode_GeomRay(PyObject *o) {
  struct __pyx_obj_4_ode_GeomRay *p = (struct __pyx_obj_4_ode_GeomRay *)o;
  __pyx_ptype_4_ode_GeomObject->tp_dealloc(o);
}

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

static int __pyx_tp_clear_4_ode_GeomRay(PyObject *o) {
  struct __pyx_obj_4_ode_GeomRay *p = (struct __pyx_obj_4_ode_GeomRay *)o;
  __pyx_ptype_4_ode_GeomObject->tp_clear(o);
  return 0;
}

static PyObject *__pyx_getprop_4_ode_7GeomRay_length(PyObject *o, void *x) {
  return __pyx_f_4_ode_7GeomRay_6length___get__(o);
}

static int __pyx_setprop_4_ode_7GeomRay_length(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_f_4_ode_7GeomRay_6length___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static struct PyMethodDef __pyx_methods_4_ode_GeomRay[] = {
  {"set", (PyCFunction)__pyx_f_4_ode_7GeomRay_set, METH_VARARGS|METH_KEYWORDS, 0},
  {"get", (PyCFunction)__pyx_f_4_ode_7GeomRay_get, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode_GeomRay[] = {
  {"length", __pyx_getprop_4_ode_7GeomRay_length, __pyx_setprop_4_ode_7GeomRay_length, 0, 0},
  {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_4_ode_GeomRay = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode.GeomRay", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode_GeomRay), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode_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_4_ode_GeomRay, /*tp_traverse*/
  __pyx_tp_clear_4_ode_GeomRay, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode_GeomRay, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4_ode_GeomRay, /*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_4_ode_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 struct __pyx_vtabstruct_4_ode__Terrain __pyx_vtable_4_ode__Terrain;

static PyObject *__pyx_tp_new_4_ode__Terrain(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode_GeomObject->tp_new(t, a, k);
  struct __pyx_obj_4_ode__Terrain *p = (struct __pyx_obj_4_ode__Terrain *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode__Terrain *)__pyx_vtabptr_4_ode__Terrain;
  p->_terrain = Py_None; Py_INCREF((PyObject *) p->_terrain);
  if (__pyx_f_4_ode_8_Terrain___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode__Terrain(PyObject *o) {
  struct __pyx_obj_4_ode__Terrain *p = (struct __pyx_obj_4_ode__Terrain *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_4_ode_8_Terrain___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF((PyObject *)p->_terrain);
  __pyx_ptype_4_ode_GeomObject->tp_dealloc(o);
}

static int __pyx_tp_traverse_4_ode__Terrain(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4_ode__Terrain *p = (struct __pyx_obj_4_ode__Terrain *)o;
  __pyx_ptype_4_ode_GeomObject->tp_traverse(o, v, a);
  if (p->_terrain) {
    e = (*v)(((PyObject*)p->_terrain), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4_ode__Terrain(PyObject *o) {
  struct __pyx_obj_4_ode__Terrain *p = (struct __pyx_obj_4_ode__Terrain *)o;
  __pyx_ptype_4_ode_GeomObject->tp_clear(o);
  Py_XDECREF((PyObject *)p->_terrain);
  p->_terrain = Py_None; Py_INCREF((PyObject *) p->_terrain);
  return 0;
}

static PyObject *__pyx_getprop_4_ode_8_Terrain_body(PyObject *o, void *x) {
  return __pyx_f_4_ode_8_Terrain_4body___get__(o);
}

static struct PyMethodDef __pyx_methods_4_ode__Terrain[] = {
  {"placeable", (PyCFunction)__pyx_f_4_ode_8_Terrain_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4_ode__Terrain[] = {
  {"body", __pyx_getprop_4_ode_8_Terrain_body, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

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

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

statichere PyTypeObject __pyx_type_4_ode__Terrain = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode._Terrain", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode__Terrain), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode__Terrain, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number__Terrain, /*tp_as_number*/
  &__pyx_tp_as_sequence__Terrain, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__Terrain, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__Terrain, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Terrain/terrain collider for Soya. This is based on Benoit Chaperot\'s\n		contributed terrain collider for ODE, with some changes to take advantage\n		of precomputed normals in Soya\'s terrain engine.\n\n		How it works: \n\n		We loop through each \"cell,\" or square of vertices in the heightfield,\n		that is underneath the axis-aligned bounding box (AABB) of the geom we\'re\n		testing for collisions with. For rendering, each cell is divided into\n		two triangles. We use ray collision to check each edge of one of the \n		triangles, because the other triangle shares edges with adjacent cells\n		and we don\'t want to check edges twice. We make a ray for each direction\n		along the edge to get two collision points so we can take the midpoint\n		of the two collision points if there is a collision. Right now the normal\n		is halfway between the normals computed by Soya for the vertices making\n		the edge being tested. This could be weighted, but we don\'t bother right\n		now and it seems to work fine.\n\n		Next, we test the plane of each triangle. We use ODE\'s own plane collision\n		routines to give us a set of collision points on the plane. We then test\n		to see if any of the collision points are within the triangle we\'re testing\n		by first seeing if the point is within the cell (a simple range check),\n		then testing if it\'s in the correct isoceles right triangle, which means\n		just looking at the sum of the x and z deltas from the upper left vertex\n		of the cell. If it\'s less than the length of one leg, it\'s in the upper\n		triangle. If it\'s greater, it\'s in the lower. We keep the normal from any\n		plane contact points we keep.\n\n		Ray collision is not currently implemented, but could easily be handled\n		using Soya\'s own raypicking routines. Likewise plane collision, which \n		might be able to use the view frustum culling routines. I don\'t currently\n		plan to implement these because I have ambitions about doing all collision\n		detection within Soya rather than using ODE\'s collision detection.\n		", /*tp_doc*/
  __pyx_tp_traverse_4_ode__Terrain, /*tp_traverse*/
  __pyx_tp_clear_4_ode__Terrain, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode__Terrain, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4_ode__Terrain, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_4_ode_8_Terrain___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode__Terrain, /*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 __pyx_vtabstruct_4_ode__GeomModel __pyx_vtable_4_ode__GeomModel;

static PyObject *__pyx_tp_new_4_ode__GeomModel(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode__TriMesh->tp_new(t, a, k);
  struct __pyx_obj_4_ode__GeomModel *p = (struct __pyx_obj_4_ode__GeomModel *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode__GeomModel *)__pyx_vtabptr_4_ode__GeomModel;
  p->model = Py_None; Py_INCREF((PyObject *) p->model);
  if (__pyx_f_4_ode_10_GeomModel___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode__GeomModel(PyObject *o) {
  struct __pyx_obj_4_ode__GeomModel *p = (struct __pyx_obj_4_ode__GeomModel *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_4_ode_10_GeomModel___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF((PyObject *)p->model);
  __pyx_ptype_4_ode__TriMesh->tp_dealloc(o);
}

static int __pyx_tp_traverse_4_ode__GeomModel(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4_ode__GeomModel *p = (struct __pyx_obj_4_ode__GeomModel *)o;
  __pyx_ptype_4_ode__TriMesh->tp_traverse(o, v, a);
  if (p->model) {
    e = (*v)(((PyObject*)p->model), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4_ode__GeomModel(PyObject *o) {
  struct __pyx_obj_4_ode__GeomModel *p = (struct __pyx_obj_4_ode__GeomModel *)o;
  __pyx_ptype_4_ode__TriMesh->tp_clear(o);
  Py_XDECREF((PyObject *)p->model);
  p->model = Py_None; Py_INCREF((PyObject *) p->model);
  return 0;
}

static struct PyMethodDef __pyx_methods_4_ode__GeomModel[] = {
  {"placeable", (PyCFunction)__pyx_f_4_ode_10_GeomModel_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4_ode__GeomModel[] = {
  {"model", T_OBJECT, offsetof(struct __pyx_obj_4_ode__GeomModel, model), READONLY, 0},
  {0, 0, 0, 0, 0}
};

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

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

statichere PyTypeObject __pyx_type_4_ode__GeomModel = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode._GeomModel", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode__GeomModel), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode__GeomModel, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number__GeomModel, /*tp_as_number*/
  &__pyx_tp_as_sequence__GeomModel, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__GeomModel, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__GeomModel, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Model collider for Soya.\n\n		Models can collide with primitives (box, sphere, capped cylinder, ray),\n		but not with other models or with terrains.\n\n		The axis-aligned bounding box (AABB) is calculated from the bounding\n		sphere of the model.\n\n		Models *must* be made of only triangles!\n		", /*tp_doc*/
  __pyx_tp_traverse_4_ode__GeomModel, /*tp_traverse*/
  __pyx_tp_clear_4_ode__GeomModel, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode__GeomModel, /*tp_methods*/
  __pyx_members_4_ode__GeomModel, /*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_4_ode__GeomModel, /*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 __pyx_vtabstruct_4_ode__GeomTerrain __pyx_vtable_4_ode__GeomTerrain;

static PyObject *__pyx_tp_new_4_ode__GeomTerrain(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_4_ode__TriMesh->tp_new(t, a, k);
  struct __pyx_obj_4_ode__GeomTerrain *p = (struct __pyx_obj_4_ode__GeomTerrain *)o;
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4_ode__GeomTerrain *)__pyx_vtabptr_4_ode__GeomTerrain;
  p->terrain = Py_None; Py_INCREF((PyObject *) p->terrain);
  if (__pyx_f_4_ode_12_GeomTerrain___new__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4_ode__GeomTerrain(PyObject *o) {
  struct __pyx_obj_4_ode__GeomTerrain *p = (struct __pyx_obj_4_ode__GeomTerrain *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_4_ode_12_GeomTerrain___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF((PyObject *)p->terrain);
  __pyx_ptype_4_ode__TriMesh->tp_dealloc(o);
}

static int __pyx_tp_traverse_4_ode__GeomTerrain(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4_ode__GeomTerrain *p = (struct __pyx_obj_4_ode__GeomTerrain *)o;
  __pyx_ptype_4_ode__TriMesh->tp_traverse(o, v, a);
  if (p->terrain) {
    e = (*v)(((PyObject*)p->terrain), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4_ode__GeomTerrain(PyObject *o) {
  struct __pyx_obj_4_ode__GeomTerrain *p = (struct __pyx_obj_4_ode__GeomTerrain *)o;
  __pyx_ptype_4_ode__TriMesh->tp_clear(o);
  Py_XDECREF((PyObject *)p->terrain);
  p->terrain = Py_None; Py_INCREF((PyObject *) p->terrain);
  return 0;
}

static struct PyMethodDef __pyx_methods_4_ode__GeomTerrain[] = {
  {"placeable", (PyCFunction)__pyx_f_4_ode_12_GeomTerrain_placeable, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4_ode__GeomTerrain[] = {
  {"terrain", T_OBJECT, offsetof(struct __pyx_obj_4_ode__GeomTerrain, terrain), READONLY, 0},
  {0, 0, 0, 0, 0}
};

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

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

statichere PyTypeObject __pyx_type_4_ode__GeomTerrain = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "_ode._GeomTerrain", /*tp_name*/
  sizeof(struct __pyx_obj_4_ode__GeomTerrain), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4_ode__GeomTerrain, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number__GeomTerrain, /*tp_as_number*/
  &__pyx_tp_as_sequence__GeomTerrain, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__GeomTerrain, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__GeomTerrain, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Terrain collider for Soya.\n		", /*tp_doc*/
  __pyx_tp_traverse_4_ode__GeomTerrain, /*tp_traverse*/
  __pyx_tp_clear_4_ode__GeomTerrain, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4_ode__GeomTerrain, /*tp_methods*/
  __pyx_members_4_ode__GeomTerrain, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_4_ode_12_GeomTerrain___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4_ode__GeomTerrain, /*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[] = {
  {"collide", (PyCFunction)__pyx_f_4_ode_collide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_collide},
  {"CloseODE", (PyCFunction)__pyx_f_4_ode_CloseODE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4_ode_CloseODE},
  {0, 0, 0, 0}
};

DL_EXPORT(void) init_ode(void); /*proto*/
DL_EXPORT(void) init_ode(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;
  __pyx_m = Py_InitModule4("_ode", __pyx_methods, 0, 0, PYTHON_API_VERSION);
  if (!__pyx_m) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 16; goto __pyx_L1;};
  __pyx_b = PyImport_AddModule("__builtin__");
  if (!__pyx_b) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 16; goto __pyx_L1;};
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 16; goto __pyx_L1;};
  if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 16; goto __pyx_L1;};
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 16; goto __pyx_L1;};
  __pyx_ptype_5_soya__CObj = __Pyx_ImportType("_soya", "_CObj", sizeof(struct __pyx_obj_5_soya__CObj)); if (!__pyx_ptype_5_soya__CObj) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 20; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__CObj->tp_dict, &__pyx_vtabptr_5_soya__CObj) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 20; goto __pyx_L1;}
  __pyx_ptype_5_soya__Image = __Pyx_ImportType("_soya", "_Image", sizeof(struct __pyx_obj_5_soya__Image)); if (!__pyx_ptype_5_soya__Image) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 21; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Image->tp_dict, &__pyx_vtabptr_5_soya__Image) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 21; goto __pyx_L1;}
  __pyx_ptype_5_soya__Material = __Pyx_ImportType("_soya", "_Material", sizeof(struct __pyx_obj_5_soya__Material)); if (!__pyx_ptype_5_soya__Material) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 22; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Material->tp_dict, &__pyx_vtabptr_5_soya__Material) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_ptype_5_soya__Model = __Pyx_ImportType("_soya", "_Model", sizeof(struct __pyx_obj_5_soya__Model)); if (!__pyx_ptype_5_soya__Model) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 23; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Model->tp_dict, &__pyx_vtabptr_5_soya__Model) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 23; goto __pyx_L1;}
  __pyx_ptype_5_soya__SimpleModel = __Pyx_ImportType("_soya", "_SimpleModel", sizeof(struct __pyx_obj_5_soya__SimpleModel)); if (!__pyx_ptype_5_soya__SimpleModel) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 24; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__SimpleModel->tp_dict, &__pyx_vtabptr_5_soya__SimpleModel) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 24; goto __pyx_L1;}
  __pyx_ptype_5_soya__CellShadingModel = __Pyx_ImportType("_soya", "_CellShadingModel", sizeof(struct __pyx_obj_5_soya__CellShadingModel)); if (!__pyx_ptype_5_soya__CellShadingModel) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 25; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__CellShadingModel->tp_dict, &__pyx_vtabptr_5_soya__CellShadingModel) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 25; goto __pyx_L1;}
  __pyx_ptype_5_soya__TreeModel = __Pyx_ImportType("_soya", "_TreeModel", sizeof(struct __pyx_obj_5_soya__TreeModel)); if (!__pyx_ptype_5_soya__TreeModel) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 26; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__TreeModel->tp_dict, &__pyx_vtabptr_5_soya__TreeModel) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 26; goto __pyx_L1;}
  __pyx_ptype_5_soya__ModelData = __Pyx_ImportType("_soya", "_ModelData", sizeof(struct __pyx_obj_5_soya__ModelData)); if (!__pyx_ptype_5_soya__ModelData) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 27; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__ModelData->tp_dict, &__pyx_vtabptr_5_soya__ModelData) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 27; goto __pyx_L1;}
  __pyx_ptype_5_soya__AnimatedModelData = __Pyx_ImportType("_soya", "_AnimatedModelData", sizeof(struct __pyx_obj_5_soya__AnimatedModelData)); if (!__pyx_ptype_5_soya__AnimatedModelData) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 28; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__AnimatedModelData->tp_dict, &__pyx_vtabptr_5_soya__AnimatedModelData) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 28; goto __pyx_L1;}
  __pyx_ptype_5_soya_Position = __Pyx_ImportType("_soya", "Position", sizeof(struct __pyx_obj_5_soya_Position)); if (!__pyx_ptype_5_soya_Position) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 29; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya_Position->tp_dict, &__pyx_vtabptr_5_soya_Position) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 29; goto __pyx_L1;}
  __pyx_ptype_5_soya__Point = __Pyx_ImportType("_soya", "_Point", sizeof(struct __pyx_obj_5_soya__Point)); if (!__pyx_ptype_5_soya__Point) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 30; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Point->tp_dict, &__pyx_vtabptr_5_soya__Point) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 30; goto __pyx_L1;}
  __pyx_ptype_5_soya__Vector = __Pyx_ImportType("_soya", "_Vector", sizeof(struct __pyx_obj_5_soya__Vector)); if (!__pyx_ptype_5_soya__Vector) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 31; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Vector->tp_dict, &__pyx_vtabptr_5_soya__Vector) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 31; goto __pyx_L1;}
  __pyx_ptype_5_soya__Vertex = __Pyx_ImportType("_soya", "_Vertex", sizeof(struct __pyx_obj_5_soya__Vertex)); if (!__pyx_ptype_5_soya__Vertex) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 32; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Vertex->tp_dict, &__pyx_vtabptr_5_soya__Vertex) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 32; goto __pyx_L1;}
  __pyx_ptype_5_soya_CoordSyst = __Pyx_ImportType("_soya", "CoordSyst", sizeof(struct __pyx_obj_5_soya_CoordSyst)); if (!__pyx_ptype_5_soya_CoordSyst) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 33; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya_CoordSyst->tp_dict, &__pyx_vtabptr_5_soya_CoordSyst) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 33; goto __pyx_L1;}
  __pyx_ptype_5_soya__Camera = __Pyx_ImportType("_soya", "_Camera", sizeof(struct __pyx_obj_5_soya__Camera)); if (!__pyx_ptype_5_soya__Camera) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 34; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Camera->tp_dict, &__pyx_vtabptr_5_soya__Camera) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 34; goto __pyx_L1;}
  __pyx_ptype_5_soya__Light = __Pyx_ImportType("_soya", "_Light", sizeof(struct __pyx_obj_5_soya__Light)); if (!__pyx_ptype_5_soya__Light) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 35; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Light->tp_dict, &__pyx_vtabptr_5_soya__Light) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 35; goto __pyx_L1;}
  __pyx_ptype_5_soya__Body = __Pyx_ImportType("_soya", "_Body", sizeof(struct __pyx_obj_5_soya__Body)); if (!__pyx_ptype_5_soya__Body) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 36; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Body->tp_dict, &__pyx_vtabptr_5_soya__Body) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 36; goto __pyx_L1;}
  __pyx_ptype_5_soya__World = __Pyx_ImportType("_soya", "_World", sizeof(struct __pyx_obj_5_soya__World)); if (!__pyx_ptype_5_soya__World) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 37; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__World->tp_dict, &__pyx_vtabptr_5_soya__World) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 37; goto __pyx_L1;}
  __pyx_ptype_5_soya__Face = __Pyx_ImportType("_soya", "_Face", sizeof(struct __pyx_obj_5_soya__Face)); if (!__pyx_ptype_5_soya__Face) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 38; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Face->tp_dict, &__pyx_vtabptr_5_soya__Face) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 38; goto __pyx_L1;}
  __pyx_ptype_5_soya__AnimatedModel = __Pyx_ImportType("_soya", "_AnimatedModel", sizeof(struct __pyx_obj_5_soya__AnimatedModel)); if (!__pyx_ptype_5_soya__AnimatedModel) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 40; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__AnimatedModel->tp_dict, &__pyx_vtabptr_5_soya__AnimatedModel) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 40; goto __pyx_L1;}
  __pyx_ptype_5_soya__Sprite = __Pyx_ImportType("_soya", "_Sprite", sizeof(struct __pyx_obj_5_soya__Sprite)); if (!__pyx_ptype_5_soya__Sprite) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 41; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Sprite->tp_dict, &__pyx_vtabptr_5_soya__Sprite) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 41; goto __pyx_L1;}
  __pyx_ptype_5_soya__Portal = __Pyx_ImportType("_soya", "_Portal", sizeof(struct __pyx_obj_5_soya__Portal)); if (!__pyx_ptype_5_soya__Portal) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 42; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Portal->tp_dict, &__pyx_vtabptr_5_soya__Portal) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 42; goto __pyx_L1;}
  __pyx_ptype_5_soya__Terrain = __Pyx_ImportType("_soya", "_Terrain", sizeof(struct __pyx_obj_5_soya__Terrain)); if (!__pyx_ptype_5_soya__Terrain) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 43; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Terrain->tp_dict, &__pyx_vtabptr_5_soya__Terrain) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 43; goto __pyx_L1;}
  __pyx_ptype_5_soya__Atmosphere = __Pyx_ImportType("_soya", "_Atmosphere", sizeof(struct __pyx_obj_5_soya__Atmosphere)); if (!__pyx_ptype_5_soya__Atmosphere) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 44; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Atmosphere->tp_dict, &__pyx_vtabptr_5_soya__Atmosphere) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 44; goto __pyx_L1;}
  __pyx_ptype_5_soya_Renderer = __Pyx_ImportType("_soya", "Renderer", sizeof(struct __pyx_obj_5_soya_Renderer)); if (!__pyx_ptype_5_soya_Renderer) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 45; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya_Renderer->tp_dict, &__pyx_vtabptr_5_soya_Renderer) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 45; goto __pyx_L1;}
  __pyx_ptype_5_soya_Context = __Pyx_ImportType("_soya", "Context", sizeof(struct __pyx_obj_5_soya_Context)); if (!__pyx_ptype_5_soya_Context) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 46; goto __pyx_L1;}
  __pyx_ptype_5_soya_RaypickData = __Pyx_ImportType("_soya", "RaypickData", sizeof(struct __pyx_obj_5_soya_RaypickData)); if (!__pyx_ptype_5_soya_RaypickData) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 47; goto __pyx_L1;}
  __pyx_ptype_5_soya_RaypickContext = __Pyx_ImportType("_soya", "RaypickContext", sizeof(struct __pyx_obj_5_soya_RaypickContext)); if (!__pyx_ptype_5_soya_RaypickContext) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 48; goto __pyx_L1;}
  __pyx_ptype_5_soya_MainLoop = __Pyx_ImportType("_soya", "MainLoop", sizeof(struct __pyx_obj_5_soya_MainLoop)); if (!__pyx_ptype_5_soya_MainLoop) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 49; goto __pyx_L1;}
  __pyx_ptype_5_soya_Glyph = __Pyx_ImportType("_soya", "Glyph", sizeof(struct __pyx_obj_5_soya_Glyph)); if (!__pyx_ptype_5_soya_Glyph) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 50; goto __pyx_L1;}
  __pyx_ptype_5_soya__Font = __Pyx_ImportType("_soya", "_Font", sizeof(struct __pyx_obj_5_soya__Font)); if (!__pyx_ptype_5_soya__Font) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 51; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Font->tp_dict, &__pyx_vtabptr_5_soya__Font) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 51; goto __pyx_L1;}
  __pyx_ptype_5_soya_ModelBuilder = __Pyx_ImportType("_soya", "ModelBuilder", sizeof(struct __pyx_obj_5_soya_ModelBuilder)); if (!__pyx_ptype_5_soya_ModelBuilder) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 52; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya_ModelBuilder->tp_dict, &__pyx_vtabptr_5_soya_ModelBuilder) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 52; goto __pyx_L1;}
  __pyx_ptype_5_soya_Traveling = __Pyx_ImportType("_soya", "Traveling", sizeof(struct __pyx_obj_5_soya_Traveling)); if (!__pyx_ptype_5_soya_Traveling) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya_Traveling->tp_dict, &__pyx_vtabptr_5_soya_Traveling) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; goto __pyx_L1;}
  __pyx_ptype_5_soya__TravelingCamera = __Pyx_ImportType("_soya", "_TravelingCamera", sizeof(struct __pyx_obj_5_soya__TravelingCamera)); if (!__pyx_ptype_5_soya__TravelingCamera) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 54; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__TravelingCamera->tp_dict, &__pyx_vtabptr_5_soya__TravelingCamera) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 54; goto __pyx_L1;}
  __pyx_ptype_5_soya__Deform = __Pyx_ImportType("_soya", "_Deform", sizeof(struct __pyx_obj_5_soya__Deform)); if (!__pyx_ptype_5_soya__Deform) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 55; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Deform->tp_dict, &__pyx_vtabptr_5_soya__Deform) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 55; goto __pyx_L1;}
  __pyx_ptype_5_soya__NoBackgroundAtmosphere = __Pyx_ImportType("_soya", "_NoBackgroundAtmosphere", sizeof(struct __pyx_obj_5_soya__NoBackgroundAtmosphere)); if (!__pyx_ptype_5_soya__NoBackgroundAtmosphere) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 33; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__NoBackgroundAtmosphere->tp_dict, &__pyx_vtabptr_5_soya__NoBackgroundAtmosphere) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 33; goto __pyx_L1;}
  __pyx_ptype_5_soya__SkyAtmosphere = __Pyx_ImportType("_soya", "_SkyAtmosphere", sizeof(struct __pyx_obj_5_soya__SkyAtmosphere)); if (!__pyx_ptype_5_soya__SkyAtmosphere) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 37; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__SkyAtmosphere->tp_dict, &__pyx_vtabptr_5_soya__SkyAtmosphere) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 37; goto __pyx_L1;}
  __pyx_ptype_5_soya_PythonCoordSyst = __Pyx_ImportType("_soya", "PythonCoordSyst", sizeof(struct __pyx_obj_5_soya_PythonCoordSyst)); if (!__pyx_ptype_5_soya_PythonCoordSyst) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 36; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya_PythonCoordSyst->tp_dict, &__pyx_vtabptr_5_soya_PythonCoordSyst) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 36; goto __pyx_L1;}
  __pyx_ptype_5_soya_CoordSystState = __Pyx_ImportType("_soya", "CoordSystState", sizeof(struct __pyx_obj_5_soya_CoordSystState)); if (!__pyx_ptype_5_soya_CoordSystState) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 42; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya_CoordSystState->tp_dict, &__pyx_vtabptr_5_soya_CoordSystState) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 42; goto __pyx_L1;}
  __pyx_ptype_5_soya__FixTraveling = __Pyx_ImportType("_soya", "_FixTraveling", sizeof(struct __pyx_obj_5_soya__FixTraveling)); if (!__pyx_ptype_5_soya__FixTraveling) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 34; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__FixTraveling->tp_dict, &__pyx_vtabptr_5_soya__FixTraveling) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 34; goto __pyx_L1;}
  __pyx_ptype_5_soya__ThirdPersonTraveling = __Pyx_ImportType("_soya", "_ThirdPersonTraveling", sizeof(struct __pyx_obj_5_soya__ThirdPersonTraveling)); if (!__pyx_ptype_5_soya__ThirdPersonTraveling) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 38; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__ThirdPersonTraveling->tp_dict, &__pyx_vtabptr_5_soya__ThirdPersonTraveling) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 38; goto __pyx_L1;}
  __pyx_ptype_5_soya__PythonMaterial = __Pyx_ImportType("_soya", "_PythonMaterial", sizeof(struct __pyx_obj_5_soya__PythonMaterial)); if (!__pyx_ptype_5_soya__PythonMaterial) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 22; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__PythonMaterial->tp_dict, &__pyx_vtabptr_5_soya__PythonMaterial) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_ptype_5_soya__CylinderSprite = __Pyx_ImportType("_soya", "_CylinderSprite", sizeof(struct __pyx_obj_5_soya__CylinderSprite)); if (!__pyx_ptype_5_soya__CylinderSprite) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 32; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__CylinderSprite->tp_dict, &__pyx_vtabptr_5_soya__CylinderSprite) < 0) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 32; goto __pyx_L1;}
  __pyx_ptype_5_soya__Bonus = __Pyx_ImportType("_soya", "_Bonus", sizeof(struct __pyx_obj_5_soya__Bonus)); if (!__pyx_ptype_5_soya__Bonus) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 38; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Bonus->tp_dict, &__pyx_vtabptr_5_soya__Bonus) < 0) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 38; goto __pyx_L1;}
  __pyx_ptype_5_soya__Particles = __Pyx_ImportType("_soya", "_Particles", sizeof(struct __pyx_obj_5_soya__Particles)); if (!__pyx_ptype_5_soya__Particles) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 20; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Particles->tp_dict, &__pyx_vtabptr_5_soya__Particles) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 20; goto __pyx_L1;}
  __pyx_ptype_5_soya_FlagFirework = __Pyx_ImportType("_soya", "FlagFirework", sizeof(struct __pyx_obj_5_soya_FlagFirework)); if (!__pyx_ptype_5_soya_FlagFirework) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 52; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya_FlagFirework->tp_dict, &__pyx_vtabptr_5_soya_FlagFirework) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 52; goto __pyx_L1;}
  __pyx_ptype_5_soya_SimpleModelBuilder = __Pyx_ImportType("_soya", "SimpleModelBuilder", sizeof(struct __pyx_obj_5_soya_SimpleModelBuilder)); if (!__pyx_ptype_5_soya_SimpleModelBuilder) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 24; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya_SimpleModelBuilder->tp_dict, &__pyx_vtabptr_5_soya_SimpleModelBuilder) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 24; goto __pyx_L1;}
  __pyx_ptype_5_soya_TreeModelBuilder = __Pyx_ImportType("_soya", "TreeModelBuilder", sizeof(struct __pyx_obj_5_soya_TreeModelBuilder)); if (!__pyx_ptype_5_soya_TreeModelBuilder) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 33; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya_TreeModelBuilder->tp_dict, &__pyx_vtabptr_5_soya_TreeModelBuilder) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 33; goto __pyx_L1;}
  __pyx_ptype_5_soya_CellShadingModelBuilder = __Pyx_ImportType("_soya", "CellShadingModelBuilder", sizeof(struct __pyx_obj_5_soya_CellShadingModelBuilder)); if (!__pyx_ptype_5_soya_CellShadingModelBuilder) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 43; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya_CellShadingModelBuilder->tp_dict, &__pyx_vtabptr_5_soya_CellShadingModelBuilder) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 43; goto __pyx_L1;}
  __pyx_ptype_5_soya__Cal3dSubMesh = __Pyx_ImportType("_soya", "_Cal3dSubMesh", sizeof(struct __pyx_obj_5_soya__Cal3dSubMesh)); if (!__pyx_ptype_5_soya__Cal3dSubMesh) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 21; goto __pyx_L1;}
  if (__Pyx_GetVtable(__pyx_ptype_5_soya__Cal3dSubMesh->tp_dict, &__pyx_vtabptr_5_soya__Cal3dSubMesh) < 0) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 21; goto __pyx_L1;}
  if (PyType_Ready(&__pyx_type_4_ode_Mass) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Mass", (PyObject *)&__pyx_type_4_ode_Mass) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
  __pyx_ptype_4_ode_Mass = &__pyx_type_4_ode_Mass;
  __pyx_vtabptr_4_ode_GeomObject = &__pyx_vtable_4_ode_GeomObject;
  __pyx_vtable_4_ode_GeomObject.__pyx_base = *__pyx_vtabptr_5_soya_CoordSyst;
  __pyx_vtable_4_ode_GeomObject.__pyx_base._invalidate = (void *)__pyx_f_4_ode_10GeomObject__invalidate;
  __pyx_vtable_4_ode_GeomObject._point_depth = (void *)__pyx_f_4_ode_10GeomObject__point_depth;
  __pyx_type_4_ode_GeomObject.tp_base = __pyx_ptype_5_soya_CoordSyst;
  __pyx_type_4_ode_GeomObject.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_4_ode_GeomObject) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 22; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_GeomObject.tp_dict, __pyx_vtabptr_4_ode_GeomObject) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 22; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomObject", (PyObject *)&__pyx_type_4_ode_GeomObject) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_ptype_4_ode_GeomObject = &__pyx_type_4_ode_GeomObject;
  if (PyType_Ready(&__pyx_type_4_ode_Contact) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Contact", (PyObject *)&__pyx_type_4_ode_Contact) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; goto __pyx_L1;}
  __pyx_ptype_4_ode_Contact = &__pyx_type_4_ode_Contact;
  __pyx_vtabptr_4_ode__Body = &__pyx_vtable_4_ode__Body;
  __pyx_vtable_4_ode__Body.__pyx_base = *__pyx_vtabptr_5_soya__World;
  __pyx_vtable_4_ode__Body.__pyx_base.__pyx_base.__pyx_base._invalidate = (void *)__pyx_f_4_ode_5_Body__invalidate;
  __pyx_vtable_4_ode__Body._add_joint = (void *)__pyx_f_4_ode_5_Body__add_joint;
  __pyx_vtable_4_ode__Body._remove_joint = (void *)__pyx_f_4_ode_5_Body__remove_joint;
  __pyx_type_4_ode__Body.tp_base = __pyx_ptype_5_soya__World;
  __pyx_type_4_ode__Body.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_4_ode__Body) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 7; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode__Body.tp_dict, __pyx_vtabptr_4_ode__Body) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 7; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "_Body", (PyObject *)&__pyx_type_4_ode__Body) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 7; goto __pyx_L1;}
  __pyx_ptype_4_ode__Body = &__pyx_type_4_ode__Body;
  __pyx_vtabptr_4_ode__World = &__pyx_vtable_4_ode__World;
  __pyx_vtable_4_ode__World.__pyx_base = *__pyx_vtabptr_5_soya__World;
  __pyx_type_4_ode__World.tp_base = __pyx_ptype_5_soya__World;
  if (PyType_Ready(&__pyx_type_4_ode__World) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode__World.tp_dict, __pyx_vtabptr_4_ode__World) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "_World", (PyObject *)&__pyx_type_4_ode__World) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; goto __pyx_L1;}
  __pyx_ptype_4_ode__World = &__pyx_type_4_ode__World;
  __pyx_vtabptr_4_ode_Joint = &__pyx_vtable_4_ode_Joint;
  __pyx_vtable_4_ode_Joint._setParam = (void *)__pyx_f_4_ode_5Joint__setParam;
  __pyx_vtable_4_ode_Joint._getParam = (void *)__pyx_f_4_ode_5Joint__getParam;
  __pyx_type_4_ode_Joint.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_4_ode_Joint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 74; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_Joint.tp_dict, __pyx_vtabptr_4_ode_Joint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 74; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Joint", (PyObject *)&__pyx_type_4_ode_Joint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 74; goto __pyx_L1;}
  __pyx_ptype_4_ode_Joint = &__pyx_type_4_ode_Joint;
  __pyx_type_4_ode_JointGroup.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_4_ode_JointGroup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 20; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "JointGroup", (PyObject *)&__pyx_type_4_ode_JointGroup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 20; goto __pyx_L1;}
  __pyx_ptype_4_ode_JointGroup = &__pyx_type_4_ode_JointGroup;
  __pyx_vtabptr_4_ode_BallJoint = &__pyx_vtable_4_ode_BallJoint;
  __pyx_vtable_4_ode_BallJoint.__pyx_base = *__pyx_vtabptr_4_ode_Joint;
  __pyx_vtable_4_ode_BallJoint.__pyx_base._setParam = (void *)__pyx_f_4_ode_9BallJoint__setParam;
  __pyx_vtable_4_ode_BallJoint.__pyx_base._getParam = (void *)__pyx_f_4_ode_9BallJoint__getParam;
  __pyx_type_4_ode_BallJoint.tp_base = __pyx_ptype_4_ode_Joint;
  if (PyType_Ready(&__pyx_type_4_ode_BallJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 378; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_BallJoint.tp_dict, __pyx_vtabptr_4_ode_BallJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 378; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "BallJoint", (PyObject *)&__pyx_type_4_ode_BallJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 378; goto __pyx_L1;}
  __pyx_ptype_4_ode_BallJoint = &__pyx_type_4_ode_BallJoint;
  __pyx_vtabptr_4_ode_HingeJoint = &__pyx_vtable_4_ode_HingeJoint;
  __pyx_vtable_4_ode_HingeJoint.__pyx_base = *__pyx_vtabptr_4_ode_Joint;
  __pyx_vtable_4_ode_HingeJoint.__pyx_base._setParam = (void *)__pyx_f_4_ode_10HingeJoint__setParam;
  __pyx_vtable_4_ode_HingeJoint.__pyx_base._getParam = (void *)__pyx_f_4_ode_10HingeJoint__getParam;
  __pyx_type_4_ode_HingeJoint.tp_base = __pyx_ptype_4_ode_Joint;
  if (PyType_Ready(&__pyx_type_4_ode_HingeJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 440; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_HingeJoint.tp_dict, __pyx_vtabptr_4_ode_HingeJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 440; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "HingeJoint", (PyObject *)&__pyx_type_4_ode_HingeJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 440; goto __pyx_L1;}
  __pyx_ptype_4_ode_HingeJoint = &__pyx_type_4_ode_HingeJoint;
  __pyx_vtabptr_4_ode_SliderJoint = &__pyx_vtable_4_ode_SliderJoint;
  __pyx_vtable_4_ode_SliderJoint.__pyx_base = *__pyx_vtabptr_4_ode_Joint;
  __pyx_vtable_4_ode_SliderJoint.__pyx_base._setParam = (void *)__pyx_f_4_ode_11SliderJoint__setParam;
  __pyx_vtable_4_ode_SliderJoint.__pyx_base._getParam = (void *)__pyx_f_4_ode_11SliderJoint__getParam;
  __pyx_type_4_ode_SliderJoint.tp_base = __pyx_ptype_4_ode_Joint;
  if (PyType_Ready(&__pyx_type_4_ode_SliderJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 572; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_SliderJoint.tp_dict, __pyx_vtabptr_4_ode_SliderJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 572; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "SliderJoint", (PyObject *)&__pyx_type_4_ode_SliderJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 572; goto __pyx_L1;}
  __pyx_ptype_4_ode_SliderJoint = &__pyx_type_4_ode_SliderJoint;
  __pyx_vtabptr_4_ode_UniversalJoint = &__pyx_vtable_4_ode_UniversalJoint;
  __pyx_vtable_4_ode_UniversalJoint.__pyx_base = *__pyx_vtabptr_4_ode_Joint;
  __pyx_vtable_4_ode_UniversalJoint.__pyx_base._setParam = (void *)__pyx_f_4_ode_14UniversalJoint__setParam;
  __pyx_vtable_4_ode_UniversalJoint.__pyx_base._getParam = (void *)__pyx_f_4_ode_14UniversalJoint__getParam;
  __pyx_type_4_ode_UniversalJoint.tp_base = __pyx_ptype_4_ode_Joint;
  if (PyType_Ready(&__pyx_type_4_ode_UniversalJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 641; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_UniversalJoint.tp_dict, __pyx_vtabptr_4_ode_UniversalJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 641; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "UniversalJoint", (PyObject *)&__pyx_type_4_ode_UniversalJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 641; goto __pyx_L1;}
  __pyx_ptype_4_ode_UniversalJoint = &__pyx_type_4_ode_UniversalJoint;
  __pyx_vtabptr_4_ode_Hinge2Joint = &__pyx_vtable_4_ode_Hinge2Joint;
  __pyx_vtable_4_ode_Hinge2Joint.__pyx_base = *__pyx_vtabptr_4_ode_Joint;
  __pyx_vtable_4_ode_Hinge2Joint.__pyx_base._setParam = (void *)__pyx_f_4_ode_11Hinge2Joint__setParam;
  __pyx_vtable_4_ode_Hinge2Joint.__pyx_base._getParam = (void *)__pyx_f_4_ode_11Hinge2Joint__getParam;
  __pyx_type_4_ode_Hinge2Joint.tp_base = __pyx_ptype_4_ode_Joint;
  if (PyType_Ready(&__pyx_type_4_ode_Hinge2Joint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 736; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_Hinge2Joint.tp_dict, __pyx_vtabptr_4_ode_Hinge2Joint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 736; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Hinge2Joint", (PyObject *)&__pyx_type_4_ode_Hinge2Joint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 736; goto __pyx_L1;}
  __pyx_ptype_4_ode_Hinge2Joint = &__pyx_type_4_ode_Hinge2Joint;
  __pyx_vtabptr_4_ode_FixedJoint = &__pyx_vtable_4_ode_FixedJoint;
  __pyx_vtable_4_ode_FixedJoint.__pyx_base = *__pyx_vtabptr_4_ode_Joint;
  __pyx_type_4_ode_FixedJoint.tp_base = __pyx_ptype_4_ode_Joint;
  if (PyType_Ready(&__pyx_type_4_ode_FixedJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 859; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_FixedJoint.tp_dict, __pyx_vtabptr_4_ode_FixedJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 859; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "FixedJoint", (PyObject *)&__pyx_type_4_ode_FixedJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 859; goto __pyx_L1;}
  __pyx_ptype_4_ode_FixedJoint = &__pyx_type_4_ode_FixedJoint;
  __pyx_vtabptr_4_ode_ContactJoint = &__pyx_vtable_4_ode_ContactJoint;
  __pyx_vtable_4_ode_ContactJoint.__pyx_base = *__pyx_vtabptr_4_ode_Joint;
  __pyx_type_4_ode_ContactJoint.tp_base = __pyx_ptype_4_ode_Joint;
  if (PyType_Ready(&__pyx_type_4_ode_ContactJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 894; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_ContactJoint.tp_dict, __pyx_vtabptr_4_ode_ContactJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 894; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "ContactJoint", (PyObject *)&__pyx_type_4_ode_ContactJoint) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 894; goto __pyx_L1;}
  __pyx_ptype_4_ode_ContactJoint = &__pyx_type_4_ode_ContactJoint;
  __pyx_vtabptr_4_ode_AMotor = &__pyx_vtable_4_ode_AMotor;
  __pyx_vtable_4_ode_AMotor.__pyx_base = *__pyx_vtabptr_4_ode_Joint;
  __pyx_vtable_4_ode_AMotor.__pyx_base._setParam = (void *)__pyx_f_4_ode_6AMotor__setParam;
  __pyx_vtable_4_ode_AMotor.__pyx_base._getParam = (void *)__pyx_f_4_ode_6AMotor__getParam;
  __pyx_type_4_ode_AMotor.tp_base = __pyx_ptype_4_ode_Joint;
  if (PyType_Ready(&__pyx_type_4_ode_AMotor) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 917; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_AMotor.tp_dict, __pyx_vtabptr_4_ode_AMotor) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 917; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "AMotor", (PyObject *)&__pyx_type_4_ode_AMotor) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 917; goto __pyx_L1;}
  __pyx_ptype_4_ode_AMotor = &__pyx_type_4_ode_AMotor;
  __pyx_vtabptr_4_ode_SpaceBase = &__pyx_vtable_4_ode_SpaceBase;
  __pyx_vtable_4_ode_SpaceBase.__pyx_base = *__pyx_vtabptr_4_ode_GeomObject;
  __pyx_type_4_ode_SpaceBase.tp_base = __pyx_ptype_4_ode_GeomObject;
  __pyx_type_4_ode_SpaceBase.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_4_ode_SpaceBase) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 6; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_SpaceBase.tp_dict, __pyx_vtabptr_4_ode_SpaceBase) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 6; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "SpaceBase", (PyObject *)&__pyx_type_4_ode_SpaceBase) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 6; goto __pyx_L1;}
  __pyx_ptype_4_ode_SpaceBase = &__pyx_type_4_ode_SpaceBase;
  __pyx_vtabptr_4_ode__TriMesh = &__pyx_vtable_4_ode__TriMesh;
  __pyx_vtable_4_ode__TriMesh.__pyx_base = *__pyx_vtabptr_4_ode_GeomObject;
  __pyx_vtable_4_ode__TriMesh._set_last_transformation = (void *)__pyx_f_4_ode_8_TriMesh__set_last_transformation;
  __pyx_type_4_ode__TriMesh.tp_base = __pyx_ptype_4_ode_GeomObject;
  if (PyType_Ready(&__pyx_type_4_ode__TriMesh) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 22; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode__TriMesh.tp_dict, __pyx_vtabptr_4_ode__TriMesh) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 22; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "_TriMesh", (PyObject *)&__pyx_type_4_ode__TriMesh) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_ptype_4_ode__TriMesh = &__pyx_type_4_ode__TriMesh;
  __pyx_vtabptr_4_ode_SimpleSpace = &__pyx_vtable_4_ode_SimpleSpace;
  __pyx_vtable_4_ode_SimpleSpace.__pyx_base = *__pyx_vtabptr_4_ode_SpaceBase;
  __pyx_type_4_ode_SimpleSpace.tp_base = __pyx_ptype_4_ode_SpaceBase;
  if (PyType_Ready(&__pyx_type_4_ode_SimpleSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 199; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_SimpleSpace.tp_dict, __pyx_vtabptr_4_ode_SimpleSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 199; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "SimpleSpace", (PyObject *)&__pyx_type_4_ode_SimpleSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 199; goto __pyx_L1;}
  __pyx_ptype_4_ode_SimpleSpace = &__pyx_type_4_ode_SimpleSpace;
  __pyx_vtabptr_4_ode_HashSpace = &__pyx_vtable_4_ode_HashSpace;
  __pyx_vtable_4_ode_HashSpace.__pyx_base = *__pyx_vtabptr_4_ode_SpaceBase;
  __pyx_type_4_ode_HashSpace.tp_base = __pyx_ptype_4_ode_SpaceBase;
  if (PyType_Ready(&__pyx_type_4_ode_HashSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 230; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_HashSpace.tp_dict, __pyx_vtabptr_4_ode_HashSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 230; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "HashSpace", (PyObject *)&__pyx_type_4_ode_HashSpace) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 230; goto __pyx_L1;}
  __pyx_ptype_4_ode_HashSpace = &__pyx_type_4_ode_HashSpace;
  __pyx_vtabptr_4_ode_GeomSphere = &__pyx_vtable_4_ode_GeomSphere;
  __pyx_vtable_4_ode_GeomSphere.__pyx_base = *__pyx_vtabptr_4_ode_GeomObject;
  __pyx_vtable_4_ode_GeomSphere.__pyx_base._point_depth = (void *)__pyx_f_4_ode_10GeomSphere__point_depth;
  __pyx_type_4_ode_GeomSphere.tp_base = __pyx_ptype_4_ode_GeomObject;
  if (PyType_Ready(&__pyx_type_4_ode_GeomSphere) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 6; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_GeomSphere.tp_dict, __pyx_vtabptr_4_ode_GeomSphere) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 6; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomSphere", (PyObject *)&__pyx_type_4_ode_GeomSphere) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 6; goto __pyx_L1;}
  __pyx_ptype_4_ode_GeomSphere = &__pyx_type_4_ode_GeomSphere;
  __pyx_vtabptr_4_ode_GeomBox = &__pyx_vtable_4_ode_GeomBox;
  __pyx_vtable_4_ode_GeomBox.__pyx_base = *__pyx_vtabptr_4_ode_GeomObject;
  __pyx_vtable_4_ode_GeomBox.__pyx_base._point_depth = (void *)__pyx_f_4_ode_7GeomBox__point_depth;
  __pyx_type_4_ode_GeomBox.tp_base = __pyx_ptype_4_ode_GeomObject;
  if (PyType_Ready(&__pyx_type_4_ode_GeomBox) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 51; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_GeomBox.tp_dict, __pyx_vtabptr_4_ode_GeomBox) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 51; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomBox", (PyObject *)&__pyx_type_4_ode_GeomBox) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 51; goto __pyx_L1;}
  __pyx_ptype_4_ode_GeomBox = &__pyx_type_4_ode_GeomBox;
  __pyx_vtabptr_4_ode_GeomPlane = &__pyx_vtable_4_ode_GeomPlane;
  __pyx_vtable_4_ode_GeomPlane.__pyx_base = *__pyx_vtabptr_4_ode_GeomObject;
  __pyx_vtable_4_ode_GeomPlane.__pyx_base._point_depth = (void *)__pyx_f_4_ode_9GeomPlane__point_depth;
  __pyx_type_4_ode_GeomPlane.tp_base = __pyx_ptype_4_ode_GeomObject;
  if (PyType_Ready(&__pyx_type_4_ode_GeomPlane) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 97; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_GeomPlane.tp_dict, __pyx_vtabptr_4_ode_GeomPlane) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 97; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomPlane", (PyObject *)&__pyx_type_4_ode_GeomPlane) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 97; goto __pyx_L1;}
  __pyx_ptype_4_ode_GeomPlane = &__pyx_type_4_ode_GeomPlane;
  __pyx_vtabptr_4_ode_GeomCCylinder = &__pyx_vtable_4_ode_GeomCCylinder;
  __pyx_vtable_4_ode_GeomCCylinder.__pyx_base = *__pyx_vtabptr_4_ode_GeomObject;
  __pyx_vtable_4_ode_GeomCCylinder.__pyx_base._point_depth = (void *)__pyx_f_4_ode_13GeomCCylinder__point_depth;
  __pyx_type_4_ode_GeomCCylinder.tp_base = __pyx_ptype_4_ode_GeomObject;
  if (PyType_Ready(&__pyx_type_4_ode_GeomCCylinder) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_GeomCCylinder.tp_dict, __pyx_vtabptr_4_ode_GeomCCylinder) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomCCylinder", (PyObject *)&__pyx_type_4_ode_GeomCCylinder) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; goto __pyx_L1;}
  __pyx_ptype_4_ode_GeomCCylinder = &__pyx_type_4_ode_GeomCCylinder;
  __pyx_vtabptr_4_ode_GeomRay = &__pyx_vtable_4_ode_GeomRay;
  __pyx_vtable_4_ode_GeomRay.__pyx_base = *__pyx_vtabptr_4_ode_GeomObject;
  __pyx_type_4_ode_GeomRay.tp_base = __pyx_ptype_4_ode_GeomObject;
  if (PyType_Ready(&__pyx_type_4_ode_GeomRay) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 197; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode_GeomRay.tp_dict, __pyx_vtabptr_4_ode_GeomRay) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 197; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "GeomRay", (PyObject *)&__pyx_type_4_ode_GeomRay) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 197; goto __pyx_L1;}
  __pyx_ptype_4_ode_GeomRay = &__pyx_type_4_ode_GeomRay;
  __pyx_vtabptr_4_ode__Terrain = &__pyx_vtable_4_ode__Terrain;
  __pyx_vtable_4_ode__Terrain.__pyx_base = *__pyx_vtabptr_4_ode_GeomObject;
  __pyx_vtable_4_ode__Terrain._get_aabb = (void *)__pyx_f_4_ode_8_Terrain__get_aabb;
  __pyx_vtable_4_ode__Terrain._collide_cell = (void *)__pyx_f_4_ode_8_Terrain__collide_cell;
  __pyx_vtable_4_ode__Terrain._collide = (void *)__pyx_f_4_ode_8_Terrain__collide;
  __pyx_type_4_ode__Terrain.tp_base = __pyx_ptype_4_ode_GeomObject;
  __pyx_type_4_ode__Terrain.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_4_ode__Terrain) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 22; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode__Terrain.tp_dict, __pyx_vtabptr_4_ode__Terrain) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 22; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "_Terrain", (PyObject *)&__pyx_type_4_ode__Terrain) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_ptype_4_ode__Terrain = &__pyx_type_4_ode__Terrain;
  __pyx_vtabptr_4_ode__GeomModel = &__pyx_vtable_4_ode__GeomModel;
  __pyx_vtable_4_ode__GeomModel.__pyx_base = *__pyx_vtabptr_4_ode__TriMesh;
  __pyx_type_4_ode__GeomModel.tp_base = __pyx_ptype_4_ode__TriMesh;
  __pyx_type_4_ode__GeomModel.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_4_ode__GeomModel) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 79; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode__GeomModel.tp_dict, __pyx_vtabptr_4_ode__GeomModel) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 79; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "_GeomModel", (PyObject *)&__pyx_type_4_ode__GeomModel) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 79; goto __pyx_L1;}
  __pyx_ptype_4_ode__GeomModel = &__pyx_type_4_ode__GeomModel;
  __pyx_vtabptr_4_ode__GeomTerrain = &__pyx_vtable_4_ode__GeomTerrain;
  __pyx_vtable_4_ode__GeomTerrain.__pyx_base = *__pyx_vtabptr_4_ode__TriMesh;
  __pyx_type_4_ode__GeomTerrain.tp_base = __pyx_ptype_4_ode__TriMesh;
  __pyx_type_4_ode__GeomTerrain.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_4_ode__GeomTerrain) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 163; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_4_ode__GeomTerrain.tp_dict, __pyx_vtabptr_4_ode__GeomTerrain) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 163; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "_GeomTerrain", (PyObject *)&__pyx_type_4_ode__GeomTerrain) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 163; goto __pyx_L1;}
  __pyx_ptype_4_ode__GeomTerrain = &__pyx_type_4_ode__GeomTerrain;

  /* "/home/jiba/src/soya/_ode.pyx":30 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n___doc__, __pyx_k33p) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 30; goto __pyx_L1;}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "/home/jiba/src/soya/ode/body.pyx":32 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_4_ode__World)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k34 = Py_None;

  /* "/home/jiba/src/soya/ode/body.pyx":48 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_4_ode__World)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k35 = Py_None;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "/home/jiba/src/soya/ode/geomobject.pyx":38 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5_soya_CoordSyst)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k51 = Py_None;
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_4_ode_SpaceBase)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k52 = Py_None;

  /* "/home/jiba/src/soya/ode/geomobject.pyx":70 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5_soya_CoordSyst)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k53 = Py_None;
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_4_ode_SpaceBase)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k54 = Py_None;

  /* "/home/jiba/src/soya/ode/space.pyx":38 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5_soya__World)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k55 = Py_None;
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_4_ode_SpaceBase)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k56 = Py_None;

  /* "/home/jiba/src/soya/ode/geoms.pyx":16 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5_soya__World)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 16; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k57 = Py_None;
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_4_ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 16; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k58 = Py_None;
  __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 16; goto __pyx_L1;}
  __pyx_k59 = __pyx_2;
  __pyx_2 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":61 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5_soya__World)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 61; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k60 = Py_None;
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_4_ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 61; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k61 = Py_None;
  __pyx_3 = PyFloat_FromDouble(1.0); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 61; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_3);
  PyTuple_SET_ITEM(__pyx_6, 1, __pyx_4);
  PyTuple_SET_ITEM(__pyx_6, 2, __pyx_5);
  __pyx_3 = 0;
  __pyx_4 = 0;
  __pyx_5 = 0;
  __pyx_k62 = __pyx_6;
  __pyx_6 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":112 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5_soya__World)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 112; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k63 = Py_None;
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_4_ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 112; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k64 = Py_None;
  __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 112; goto __pyx_L1;}
  __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 112; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 112; goto __pyx_L1;}
  __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 112; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_7, 0, __pyx_3);
  PyTuple_SET_ITEM(__pyx_7, 1, __pyx_4);
  PyTuple_SET_ITEM(__pyx_7, 2, __pyx_5);
  __pyx_3 = 0;
  __pyx_4 = 0;
  __pyx_5 = 0;
  __pyx_k65 = __pyx_7;
  __pyx_7 = 0;
  __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 112; goto __pyx_L1;}
  __pyx_k66 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":160 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5_soya__World)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k67 = Py_None;
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_4_ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k68 = Py_None;
  __pyx_4 = PyFloat_FromDouble(0.5); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; goto __pyx_L1;}
  __pyx_k69 = __pyx_4;
  __pyx_4 = 0;
  __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; goto __pyx_L1;}
  __pyx_k70 = __pyx_5;
  __pyx_5 = 0;

  /* "/home/jiba/src/soya/ode/geoms.pyx":211 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5_soya__World)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 211; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k71 = Py_None;
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_4_ode_SpaceBase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 211; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k72 = Py_None;
  __pyx_8 = PyFloat_FromDouble(1.0); if (!__pyx_8) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 211; goto __pyx_L1;}
  __pyx_k73 = __pyx_8;
  __pyx_8 = 0;

  /* "/home/jiba/src/soya/ode/terrain.pyx":377 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_4_ode_SpaceBase)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 377; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k74 = Py_None;

  /* "/home/jiba/src/soya/ode/terrain.pyx":384 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_4_ode_SpaceBase)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 384; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k75 = Py_None;

  /* "/home/jiba/src/soya/ode/terrain.pyx":402 */
  __pyx_v_4_ode__terrain_plane = dCreatePlane(0,0.0,1.0,0.0,0.0);

  /* "/home/jiba/src/soya/ode/terrain.pyx":403 */
  __pyx_v_4_ode__terrain_ray = dCreateRay(0,1.0);

  /* "/home/jiba/src/soya/ode/terrain.pyx":431 */
  __pyx_v_4_ode_dTerrainGeomClass.bytes = 0;

  /* "/home/jiba/src/soya/ode/terrain.pyx":432 */
  __pyx_v_4_ode_dTerrainGeomClass.collider = __pyx_f_4_ode_TerrainGetColliderFn;

  /* "/home/jiba/src/soya/ode/terrain.pyx":433 */
  __pyx_v_4_ode_dTerrainGeomClass.aabb = __pyx_f_4_ode_TerrainGetAABB;

  /* "/home/jiba/src/soya/ode/terrain.pyx":434 */
  __pyx_v_4_ode_dTerrainGeomClass.aabb_test = 0;

  /* "/home/jiba/src/soya/ode/terrain.pyx":435 */
  __pyx_v_4_ode_dTerrainGeomClass.dtor = 0;

  /* "/home/jiba/src/soya/ode/terrain.pyx":439 */
  __pyx_v_4_ode_dTerrainClass = dCreateGeomClass((&__pyx_v_4_ode_dTerrainGeomClass));

  /* "/home/jiba/src/soya/ode/model.pyx":95 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5_soya__SimpleModel)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 95; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k76 = Py_None;

  /* "/home/jiba/src/soya/ode/model.pyx":226 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_4_ode_SpaceBase)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 226; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_k77 = Py_None;

  /* "/home/jiba/src/soya/_ode.pyx":170 */
  __pyx_k78 = 8;

  /* "/home/jiba/src/soya/_ode.pyx":223 */
  __pyx_9 = PyTuple_New(1); if (!__pyx_9) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 223; goto __pyx_L1;}
  Py_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_9, 0, Py_None);
  __pyx_10 = PyObject_CallObject(((PyObject*)__pyx_ptype_4_ode__Body), __pyx_9); if (!__pyx_10) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 223; goto __pyx_L1;}
  Py_DECREF(__pyx_9); __pyx_9 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_environment, __pyx_10) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 223; goto __pyx_L1;}
  Py_DECREF(__pyx_10); __pyx_10 = 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);
  __Pyx_AddTraceback("_ode");
}

static char *__pyx_filenames[] = {
  "mass.pyx",
  "contact.pyx",
  "world.pyx",
  "body.pyx",
  "joints.pyx",
  "geomobject.pyx",
  "space.pyx",
  "geoms.pyx",
  "terrain.pyx",
  "model.pyx",
  "_ode.pyx",
  "base.pxd",
  "atmosphere.pxd",
  "coordsyst.pxd",
  "traveling_camera.pxd",
  "material.pxd",
  "sprite.pxd",
  "particle.pxd",
  "model_builder.pxd",
  "model.pxd",
};
statichere char **__pyx_f = __pyx_filenames;

/* Runtime support code */

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

static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, 
    long size) 
{
    PyObject *py_module_name = 0;
    PyObject *py_class_name = 0;
    PyObject *py_name_list = 0;
    PyObject *py_module = 0;
    PyObject *result = 0;
    
    py_module_name = PyString_FromString(module_name);
    if (!py_module_name)
        goto bad;
    py_class_name = PyString_FromString(class_name);
    if (!py_class_name)
        goto bad;
    py_name_list = PyList_New(1);
    if (!py_name_list)
        goto bad;
    Py_INCREF(py_class_name);
    if (PyList_SetItem(py_name_list, 0, py_class_name) < 0)
        goto bad;
    py_module = __Pyx_Import(py_module_name, py_name_list);
    if (!py_module)
        goto bad;
    result = PyObject_GetAttr(py_module, py_class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError, 
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError, 
            "%s.%s does not appear to be the correct type object",
            module_name, class_name);
        goto bad;
    }
    goto done;
bad:
    Py_XDECREF(result);
    result = 0;
done:
    Py_XDECREF(py_module_name);
    Py_XDECREF(py_class_name);
    Py_XDECREF(py_name_list);
    return (PyTypeObject *)result;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
    PyObject *__import__ = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    __import__ = PyObject_GetAttrString(__pyx_b, "__import__");
    if (!__import__)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    module = PyObject_CallFunction(__import__, "OOOO",
        name, global_dict, empty_dict, list);
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(__import__);
    Py_XDECREF(empty_dict);
    return module;
}

static int __Pyx_GetVtable(PyObject *dict, void *vtabptr) {
    int result;
    PyObject *pycobj;
    
    pycobj = PyMapping_GetItemString(dict, "__pyx_vtable__");
    if (!pycobj)
        goto bad;
    *(void **)vtabptr = PyCObject_AsVoidPtr(pycobj);
    if (!*(void **)vtabptr)
        goto bad;
    result = 0;
    goto done;

bad:
    result = -1;
done:
    Py_XDECREF(pycobj);
    return result;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
    PyObject *pycobj = 0;
    int result;
    
    pycobj = PyCObject_FromVoidPtr(vtable, 0);
    if (!pycobj)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0)
        goto bad;
    result = 0;
    goto done;

bad:
    result = -1;
done:
    Py_XDECREF(pycobj);
    return result;
}

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